Bug 12799 - Compilation fails in Cygwin environment.
Compilation fails in Cygwin environment.
Status: NEEDINFO
Product: TALLOC
Classification: Unclassified
Component: libtalloc
unspecified
x64 Windows 10
: P5 normal
: ---
Assigned To: Simo Sorce
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-05-22 23:36 UTC by Tony Malykh
Modified: 2017-07-08 23:28 UTC (History)
1 user (show)

See Also:


Attachments
This tarball contains: (79.60 KB, application/x-gzip)
2017-05-22 23:36 UTC, Tony Malykh
no flags Details
Patch to try... (785 bytes, patch)
2017-05-23 09:43 UTC, Stefan Metzmacher
no flags Details
Tarball with build logs after patching (79.89 KB, application/x-gzip)
2017-05-24 17:46 UTC, Tony Malykh
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Malykh 2017-05-22 23:36:47 UTC
Created attachment 13230 [details]
This tarball contains:

See attached log files for details.
Comment 1 Stefan Metzmacher 2017-05-23 09:43:04 UTC
Created attachment 13231 [details]
Patch to try...

Can you try if the attached patch fixes the problem?
Comment 2 Tony Malykh 2017-05-24 17:46:54 UTC
Created attachment 13233 [details]
Tarball with build logs after patching

After applying the patch the error message is different, see attached build logs.
Comment 3 Tony Malykh 2017-05-28 00:28:43 UTC
I managed to get the build process working under Cygwin. I am now trying to make sure that the application that consumes libtalloc can find it and then I'll upload the patch.
Comment 4 Stefan Metzmacher 2017-07-04 19:54:54 UTC
Any update?
Comment 5 Tony Malykh 2017-07-08 23:28:03 UTC
I apologize for a delay, I've been temporarily overwhelmed by other
things im my life.

Here are my findings about compiling talloc on cygwin.

It turns out that if you want to consume shared object (DLL library)
in cygwin you need to have it saved as two copies. One copy should be
called cygtalloc-2.dll and this is the one that will be used at
runtime to call talloc functions. The other copy will be used by gcc
at compile-time or link-time. To the best of my knowledge, the second
copy can be named in many ways, it can be cygtalloc.dll or
cygtalloc.so or even libtalloc.so, any of these seems to work fine.

Since talloc's build script tries to build two libraries: talloc and
pytalloc-utils, and the later one depends on and being linked against
the former, gcc expects to find cygtalloc.dll, but the build script
saves the talloc so as cygtalloc-2.dll.


The proper solution would be to change the build file to create a
symlink cygtalloc.dll-> cygtalloc-2.dll and cygpytalloc-util.dll ->
cygpytalloc-util-2.dll in bin/default directory.

So far I have come up with the following workaround script:

mkdir -p bin/default
ln -s cygtalloc-2.dll bin/default/cygtalloc.dll
ln -s cygpytalloc-util-2.dll bin/default/cygpytalloc-util.dll
make
make install
cp bin/default/cygtalloc-2.dll /usr/bin/
(I hope the script is readable and the bug tracker didn't reformat it.)

This script seems to do the job of building and installing talloc on
cygwin. Do you think you could include this script in talloc repo?

Thanks
Tony



On 7/4/17, samba-bugs@samba.org <samba-bugs@samba.org> wrote:
> https://bugzilla.samba.org/show_bug.cgi?id=12799
>
> Stefan Metzmacher <metze@samba.org> changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|NEW                         |NEEDINFO
>
> --- Comment #4 from Stefan Metzmacher <metze@samba.org> ---
> Any update?
>
> --
> You are receiving this mail because:
> You reported the bug.
>