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
>Organization:
Omniscient Technologies
kovert%omniscient.com@localhost
>Environment:
System: Darwin transient.omniscient.com 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
>Description:
        devel/libexecinfo fails on Darwin 10.9+Xcode 5 due to gcc assumptions
>How-To-Repeat:
        bootstrap pkgsrc with clang, attempt to build devel/libexecinfo
>Fix:

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
--no-whole-archive.

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
broken.

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...

Thanks,
-Todd

--- pkgsrc/mk/platform/Darwin.mk        31 Dec 2013 11:13:43 -0000      1.61
+++ pkgsrc/mk/platform/Darwin.mk        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_NO_WHOLE_ARCHIVE_FLAG=  
+.else
 _OPSYS_WHOLE_ARCHIVE_FLAG=     -Wl,--whole-archive
 _OPSYS_NO_WHOLE_ARCHIVE_FLAG=  -Wl,--no-whole-archive
+.endif
 
 _OPSYS_CAN_CHECK_SHLIBS=       no # can't use readelf in 
check/bsd.check-vars.mk
 

--- pkgsrc/pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.lib.mk     25 Oct 
2013 13:53:03 -0000      1.4
+++ pkgsrc/pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.lib.mk     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= -Wl,-force_load
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG= 
+.else
+_OPSYS_WHOLE_ARCHIVE_FLAG= --whole-archive
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG= --no-whole-archive
+.endif
+
 lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
     ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
        @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} \
+           ${_OPSYS_WHOLE_ARCHIVE_FLAG} ${SOLIB} \
+           ${_OPSYS_NO_WHOLE_ARCHIVE_FLAG) ${LDADD} \
            -L${DESTDIR}${LIBDIR} -R${LIBDIR} \
            ${SHLIB_LDENDFILE}
 .else
        $(CC) -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
            ${SHLIB_LDSTARTFILE} \
-           --whole-archive ${SOLIB} --no-whole-archive ${LDADD} \
+           ${_OPSYS_WHOLE_ARCHIVE_FLAG} ${SOLIB} \
+           ${_OPSYS_NO_WHOLE_ARCHIVE_FLAG} ${LDADD} \
            ${SHLIB_LDENDFILE}
 .endif
 .if ${OBJECT_FMT} == "ELF"



Home | Main Index | Thread Index | Old Index