pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/48966: libexecinfo does not work under Darwin 10.9 (mavericks)

>Number:         48966
>Category:       pkg
>Synopsis:       libexecinfo does not work under Darwin 10.9 (mavericks)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 05 17:45:01 +0000 2014
>Originator:     Todd Kover
>Release:        Mac OS 10.9.4
Omniscient Technologies
System: Darwin 13.3.0 Darwin Kernel Version 13.3.0: 
Tue Jun  3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Architecture: x86_64
Machine: amd64
        devel/libexecinfo fails on Darwin 10.9+Xcode 5 due to gcc assumptions
        bootstrap pkgsrc with clang, attempt to build devel/libexecinfo

The --whole-archive option is not legal for gcc, and instead -force_load
needs to be passed to ld via clang.  I don't think there is an equivalent of

The second of these patches actually fixes the problem for devel/libexecinfo.
The first patch makes a similar change for other pkgsrc items that may be

I did not test it on an older os/x machine but I think the ifdefs will
cause old gnu based ld's to work, but the newer ones not to.  I did test on
the machine mentioned above.

Note that with the next os/x release (presumably 10.10), the Darwin regexps
will probably start failing; this patch does not address this...


--- pkgsrc/mk/platform/        31 Dec 2013 11:13:43 -0000      1.61
+++ pkgsrc/mk/platform/        5 Jul 2014 17:29:47 -0000
@@ -121,8 +121,13 @@
 # flags passed to the linker to extract all symbols from static archives.
 # this is GNU ld.
+.if empty(MACHINE_PLATFORM:MDarwin-[0-8].*-*)
+_OPSYS_WHOLE_ARCHIVE_FLAG=     -Wl,-force-load
 _OPSYS_WHOLE_ARCHIVE_FLAG=     -Wl,--whole-archive
 _OPSYS_NO_WHOLE_ARCHIVE_FLAG=  -Wl,--no-whole-archive
 _OPSYS_CAN_CHECK_SHLIBS=       no # can't use readelf in 

--- pkgsrc/pkgtools/bootstrap-mk-files/files/mods/     25 Oct 
2013 13:53:03 -0000      1.4
+++ pkgsrc/pkgtools/bootstrap-mk-files/files/mods/     5 Jul 
2014 17:30:32 -0000
@@ -370,6 +370,15 @@
 lib${LIB}_pic.a:: ${SOBJS} __archivebuild
        @echo building shared object ${LIB} library
+#.if defined(PKGSRC_COMPILER) && ${PKGSRC_COMPILER} == 'clang'
+.if empty(MACHINE_PLATFORM:MDarwin-[0-8].*-*)
+_OPSYS_WHOLE_ARCHIVE_FLAG= --whole-archive
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG= --no-whole-archive
        @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
@@ -377,14 +386,15 @@
 .if defined(DESTDIR)
        $(CC) -nostdlib -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
            ${SHLIB_LDSTARTFILE} \
-           --whole-archive ${SOLIB} \
-           --no-whole-archive ${LDADD} \
            -L${DESTDIR}${LIBDIR} -R${LIBDIR} \
        $(CC) -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
            ${SHLIB_LDSTARTFILE} \
-           --whole-archive ${SOLIB} --no-whole-archive ${LDADD} \
 .if ${OBJECT_FMT} == "ELF"

Home | Main Index | Thread Index | Old Index