[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Mac OS X: Failed link, linking against a plists impersonating object files???



On Sun, Sep 22, 2013 at 1:48 PM, Frank Lahm <fl@xxxxxxxxxx> wrote:
>
> Am 22.09.2013 um 19:34 schrieb Jeffrey Walton <noloader@xxxxxxxxx>:
>
>> On Sun, Sep 22, 2013 at 10:26 AM, Nick Mathewson <nickm@xxxxxxxxxxxxx> wrote:
>>> On Sun, Sep 22, 2013 at 5:59 AM, Jeffrey Walton <noloader@xxxxxxxxx> wrote:
>>>> Hi All,
>>>>
>>>> I'm building on Mac OS X 10.8.4 (x64). The library configured OK, but
>>>> it attempts to link against some plist files which are named like
>>>> object files.
>>>>
>>>> ...
>> I'm using the tarball libevent-2.0.21-stable.tar.gz dated 2012-11-18.
>
> fwiw, works for me:
>
> $ sw_vers
> ProductName:    Mac OS X
> ProductVersion: 10.8.5
> BuildVersion:   12F37
> $ grep AM_INIT_AUTOMAKE configure.in
> AM_INIT_AUTOMAKE(libevent,2.0.21-stable)
> $ make clean > /dev/null && make > /dev/null 2>&1  && echo success || echo failure
> success
> $
>
> What command is run by make if you manually rebuild event.o ? This is what I see:
>
> $ rm event.o && make event.o
> gcc -DHAVE_CONFIG_H -I.  -I./compat -I./include -I./include    -g -O2 -Wall -fno-strict-aliasing -Wno-deprecated-declarations -D_THREAD_SAFE  -MT event.o -MD -MP -MF .deps/event.Tpo -c -o event.o event.c
> mv -f .deps/event.Tpo .deps/event.Po
>
I get the same result (XML/Object file impersonation) when I invoke
from the command line without libtool:

$ /usr/local/bin/clang --analyze -DHAVE_CONFIG_H -I. -I./compat
-I./include -I./include -g -O2 -Wall -fno-strict-aliasing
-Wno-deprecated-declarations -D_THREAD_SAFE -MT event.lo -MD -MP -MF
.deps/event.Tpo -c event.c  -fno-common -DPIC -o .libs/event.o
...
$ file .libs/event.o
.libs/event.o: XML  document text
$ lipo -info .libs/event.o
lipo: can't figure out the architecture type of: .libs/event.o

*****
I've been trying to use Clang:

$ export CC=/usr/local/bin/clang CXX=/usr/local/bin/clang++
$ ./configure
libtool: compile:  /usr/local/bin/clang --analyze -DHAVE_CONFIG_H -I.
-I./compat -I./include -I./include -g -O2 -Wall -fno-strict-aliasing
-Wno-deprecated-declarations -D_THREAD_SAFE -MT event.lo -MD -MP -MF
.deps/event.Tpo -c event.c  -fno-common -DPIC -o .libs/event.o
...

*****
If I pass --analyze through CFLAGS/CXXFLAGS, I can't get past ./configure:

$ export CC=/usr/local/bin/clang CXX=/usr/local/bin/clang++
$ export CFLAGS="--analyze" CXXFLAGS="$CFLAGS"
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
...
checking host system type... x86_64-apple-darwin12.5.0
checking for gcc... /usr/local/bin/clang
checking whether the C compiler works... yes
checking for C compiler default output file name... conftest.plist
checking for suffix of executables... .plist
checking whether we are cross compiling... configure: error: in
`/Users/jwalton/Desktop/libevent-2.0.21-stable':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

*****
Clang 3.3 is incredibly useful, and its one of the tools I use to
acceptance test external libraries. Its picked up a few issues in
libevent so far: https://sourceforge.net/p/levent/bugs/312/.

I can't wait to see the results of dynamic analysis using the
sanitizers, but I need to get past compile/link ;)

Jeff
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.