pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: libexecinfo fails to build using clang on Darwin
I looked into this, and for me, changing Darwin.mk has no effect --
it appears that libexecinfo is actually using berkeley make (being
from freebsd) and its including bsd.lib.mk (installed by bootstrap) which
makes the same assumption for building shared libraries and needs the
--whole_archive -> -force-load change made. Presumably that comes from
NetBSD, so it probably does not need darwin related ifdefs...
I'm am not clear on what the right fix is here, though. I'm happy to
provide a patch if someone can give me some hints.
-Todd
--- rest of thread ---
> On Mon, May 26, 2014 at 12:09 AM, Xiyue Deng <manphiz%gmail.com@localhost>
> wrote:
> > On Sun, May 25, 2014 at 11:44 PM, Xiyue Deng <manphiz%gmail.com@localhost>
> > wrote:
> >> Hi,
> >>
> >> When trying to build cmake, libexecinfo fails with the following errors:
> >>
> >> ----------8<----------
> >> $ bmake install
> >> => Bootstrap dependency digest>=20010302: found digest-20121220
> >> ===> Installing dependencies for libexecinfo-1.1
> >> => Tool dependency nbpatch-[0-9]*: found nbpatch-20100124
> >> ===> Creating toolchain wrappers for libexecinfo-1.1
> >> ===> Configuring for libexecinfo-1.1
> >> ===> Building for libexecinfo-1.1
> >> --- execinfo.o ---
> >> --- execinfo.so ---
> >> --- execinfo.o ---
> >> clang -pipe -O2 -c execinfo.c
> >> --- execinfo.so ---
> >> clang -pipe -O2 -c -fPIC -DPIC execinfo.c -o execinfo.so
> >> --- stacktraverse.o ---
> >> clang -pipe -O2 -c stacktraverse.c
> >> --- stacktraverse.so ---
> >> clang -pipe -O2 -c -fPIC -DPIC stacktraverse.c -o stacktraverse.so
> >> --- libexecinfo_pic.a ---
> >> building shared object execinfo library
> >> ar -c -q libexecinfo_pic.a `NM=nm lorder stacktraverse.so execinfo.so
> >> | tsort -q`
> >> --- libexecinfo.a ---
> >> building standard execinfo library
> >> ar -c -q libexecinfo.a `NM=nm lorder stacktraverse.o execinfo.o | tsort
> >> -q`
> >> --- libexecinfo_pic.a ---
> >> ranlib libexecinfo_pic.a
> >> --- libexecinfo.so.1.0 ---
> >> building shared execinfo library (version 1.0)
> >> clang -shared -o libexecinfo.so.1.0 --whole-archive
> >> libexecinfo_pic.a --no-whole-archive -lm
> >> --- libexecinfo.a ---
> >> ranlib libexecinfo.a
> >> --- libexecinfo.so.1.0 ---
> >> clang: error: unsupported option '--whole-archive'
> >> clang: error: unsupported option '--no-whole-archive'
> >> *** [libexecinfo.so.1.0] Error code 1
> >>
> >> bmake: stopped in /Users/dxy/pkgsrc/devel/libexecinfo/work/libexecinfo-1.1
> >> 1 error
> >>
> >> bmake: stopped in /Users/dxy/pkgsrc/devel/libexecinfo/work/libexecinfo-1.1
> >> *** Error code 2
> >>
> >> Stop.
> >> bmake: stopped in /Users/dxy/pkgsrc/devel/libexecinfo
> >> *** Error code 1
> >>
> >> Stop.
> >> bmake: stopped in /Users/dxy/pkgsrc/devel/libexecinfo
> >> ----------8<----------
> >>
> >> I tried to modify work/.wrapper/tmp/cache and removed args in
> >> "--whole-archive" and "--no-whole-archive" and it seems to pass, but
> >> this is not fixing the issue and I'm not sure whether it is still
> >> producing the correct .a.
> >>
> >> Any comment is appreciated.
> >
> > Forgot to mention, I was using xcode 5.1 on Mac OS X 10.9 Mavericks.
> >
> > $ clang -v
> > Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
> > Target: x86_64-apple-darwin13.2.0
> > Thread model: posix
>
> Turns out the issue is that mk/platform/Darwin.mk is using the wrong
> flags for linker to extract all symbols from static archives. It
> assumes ld is GNU ld which is not the case. The correct flag is
> "-Wl,-force_unload". Will file a separate PR with patch.
Home |
Main Index |
Thread Index |
Old Index