Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#34222 closed defect (fixed)

Using apple-gcc42 on PPC Tiger/Mac OS X 10.4.11 produces ld error with -no_pie

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.0.4
Keywords: Cc: jeremyhu (Jeremy Huddleston Sequoia),
Port: apple-gcc42

Description

Using apple-gcc42 @5666.3, Revision 4 (lang) to build the NS variant of GNU Emacs 24.1.50 leads to this:

gcc-apple-4.2 -std=gnu99 -I/opt/local/include -L/opt/local/lib  -Demacs -DHAVE_CONFIG_H  -I. -I/Volumes/Mainz/Users/pete/Quellen/Emacs_CVS/emacs-24.1.50/src -I../lib -I/Volumes/Mainz/Users/pete/Quellen/Emacs_CVS/emacs-24.1.50/src/../lib   -I/usr/X11R6/include     -I/opt/local/include/libxml2         -MMD -MF deps/.d -MP     -g -H -pipe -fPIC -fno-common -Os -mcpu=7450 -mtune=7450 -faltivec  -fno-pie -prebind -framework AppKit -Xlinker -headerpad -Xlinker 6C8 -Wl,-bind_at_load -Wl,-t \
  -o temacs pre-crt0.o dispnew.o frame.o scroll.o xdisp.o menu.o  window.o charset.o coding.o category.o ccl.o character.o chartab.o bidi.o cm.o term.o terminal.o xfaces.o    emacs.o keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o font.o print.o lread.o syntax.o unexmacosx.o bytecode.o process.o gnutls.o callproc.o region-cache.o sound.o atimer.o doprnt.o intervals.o textprop.o composite.o xml.o   fontset.o fringe.o image.o   nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o terminfo.o lastfile.o       ../lib/libgnu.a         -L/opt/local/lib -lxml2    -lresolv  -lncurses         -lpthread
ld: unknown option: -no_pie
collect2: ld returned 1 exit status
make[2]: *** [temacs] Error 1

The text "no_pie" is not contained in the GNU Emacs sources or any other with it supplied file. -fno-pie, although senseless on PowerPC, is introduced by the configure script and can be corrected. Which ld gets used is unclear to me, a few ld exist meanwhile:

/opt/local/bin/ld
/opt/local/libexec/ld64/ld
/usr/bin/ld

Further tests without -fno-pie and tries to determine which ld is used will be performed after sleep.

Change History (7)

comment:1 in reply to:  description Changed 13 years ago by ballapete (Peter "Pete" Dyballa)

This looks like #34064...

comment:2 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Add '-v -Wl,-v' to the command line to get more information on how the linker is being invoked.

The linker being used should be /opt/local/bin/ld which should support the flag. What version of the ld64 port do you have installed?

comment:3 in reply to:  2 Changed 13 years ago by ballapete (Peter "Pete" Dyballa)

Replying to jeremyhu@…:

Add '-v -Wl,-v' to the command line to get more information on how the linker is being invoked.

The linker being used should be /opt/local/bin/ld which should support the flag. What version of the ld64 port do you have installed?

ld64 @85.2.1_5 (active)

During configuration and compilation I can see this report:

@(#)PROGRAM:ld  PROJECT:ld64-85.2.1

so it's clearly /opt/local/bin/ld. Interestingly compilation without Mac OS X frameworks succeeds without -faltivec, but in the end ld reports a strange problem with "duplicate dylibs":

gcc-apple-4.2 -std=gnu99 -I/opt/local/include -L/opt/local/lib  -Demacs -DHAVE_CONFIG_H  -I. -I.../emacs-24.1.50/src -I../lib -I.../emacs-24.1.50/src/../lib   -I/opt/local/include -I/opt/local/include -I/opt/local/include/freetype2       -I/opt/local/include/libxml2     -I/opt/local/include/freetype2 -I/opt/local/include   -I/opt/local/include   -I/opt/local/include/freetype2 -I/opt/local/include    -MMD -MF deps/.d -MP     -g -H -pipe -fPIC -fno-common -Os -mcpu=7450 -mtune=7450  -prebind  -Xlinker -headerpad -Xlinker 690 -v -Wl,-v -Wl,-bind_at_load -Wl,-t -L/opt/local/lib \
	  -o temacs pre-crt0.o dispnew.o frame.o scroll.o xdisp.o menu.o xmenu.o window.o charset.o coding.o category.o ccl.o character.o chartab.o bidi.o cm.o term.o terminal.o xfaces.o xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o   emacs.o keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o font.o print.o lread.o syntax.o unexmacosx.o bytecode.o process.o gnutls.o callproc.o region-cache.o sound.o atimer.o doprnt.o intervals.o textprop.o composite.o xml.o     xfont.o ftfont.o xftfont.o ftxfont.o  terminfo.o lastfile.o     widget.o  ../lib/libgnu.a  ../lwlib/liblw.a  -lXaw3d -lXmu -lXt -lSM -lICE -lXext      -lX11 -lXrender -L/opt/local/lib -lXft       -L/opt/local/lib -lxml2    -lresolv  -lncurses    -L/opt/local/lib -lfreetype   -L/opt/local/lib -lfontconfig   -Wl,-framework,CoreServices -Wl,-framework,ApplicationServices -L/opt/local/lib -lz -lotf -lfreetype     -lpthread     
Using built-in specs.
Target: powerpc-apple-darwin8
Configured with: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_apple-gcc42/apple-gcc42/work/objroot/src/configure --disable-checking --enable-werror --prefix=/opt/local --mandir=/opt/local/share/man --enable-languages=c,c++,objc,obj-c++ --libexecdir=/opt/local/libexec/apple-gcc42 --libdir=/opt/local/lib/apple-gcc42 --includedir=/opt/local/include/apple-gcc42 --program-suffix=-apple-4.2 --with-system-zlib --disable-nls --with-slibdir=/usr/lib --build=powerpc-apple-darwin8 --with-gxx-include-dir=/usr/include/c++/4.0.0 --host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
 /opt/local/libexec/apple-gcc42/gcc/powerpc-apple-darwin8/4.2.1/collect2 -dynamic -arch ppc7450 -macosx_version_min 10.4 -prebind -weak_reference_mismatches non-weak -o temacs -lcrt1.o -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib/apple-gcc42/gcc/powerpc-apple-darwin8/4.2.1 -L/opt/local/lib/apple-gcc42/gcc/powerpc-apple-darwin8/4.2.1/../../.. -headerpad 690 -v -bind_at_load -t pre-crt0.o dispnew.o frame.o scroll.o xdisp.o menu.o xmenu.o window.o charset.o coding.o category.o ccl.o character.o chartab.o bidi.o cm.o term.o terminal.o xfaces.o xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o emacs.o keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o font.o print.o lread.o syntax.o unexmacosx.o bytecode.o process.o gnutls.o callproc.o region-cache.o sound.o atimer.o doprnt.o intervals.o textprop.o composite.o xml.o xfont.o ftfont.o xftfont.o ftxfont.o terminfo.o lastfile.o widget.o ../lib/libgnu.a ../lwlib/liblw.a -lXaw3d -lXmu -lXt -lSM -lICE -lXext -lX11 -lXrender -lXft -lxml2 -lresolv -lncurses -lfreetype -lfontconfig -framework CoreServices -framework ApplicationServices -lz -lotf -lfreetype -lpthread -lgcc_s.10.4 -lgcc -lSystemStubs -lSystem
collect2 version 4.2.1 (Apple Inc. build 5666) (dot 3) (Darwin/PowerPC)
/opt/local/libexec/apple-gcc42/gcc/powerpc-apple-darwin8/4.2.1/ld -dynamic -arch ppc7450 -macosx_version_min 10.4 -prebind -weak_reference_mismatches non-weak -o temacs -lcrt1.o -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib/apple-gcc42/gcc/powerpc-apple-darwin8/4.2.1 -L/opt/local/lib/apple-gcc42/gcc/powerpc-apple-darwin8/4.2.1/../../.. -headerpad 690 -v -bind_at_load -t pre-crt0.o dispnew.o frame.o scroll.o xdisp.o menu.o xmenu.o window.o charset.o coding.o category.o ccl.o character.o chartab.o bidi.o cm.o term.o terminal.o xfaces.o xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o emacs.o keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o font.o print.o lread.o syntax.o unexmacosx.o bytecode.o process.o gnutls.o callproc.o region-cache.o sound.o atimer.o doprnt.o intervals.o textprop.o composite.o xml.o xfont.o ftfont.o xftfont.o ftxfont.o terminfo.o lastfile.o widget.o ../lib/libgnu.a ../lwlib/liblw.a -lXaw3d -lXmu -lXt -lSM -lICE -lXext -lX11 -lXrender -lXft -lxml2 -lresolv -lncurses -lfreetype -lfontconfig -framework CoreServices -framework ApplicationServices -lz -lotf -lfreetype -lpthread -lgcc_s.10.4 -lgcc -lSystemStubs -lSystem
/usr/lib/crt1.o
pre-crt0.o
....o
widget.o
../lib/libgnu.a
../lwlib/liblw.a
/opt/local/lib/libXaw3d.dylib
/opt/local/lib/libXmu.dylib
/opt/local/lib/libXt.dylib
/opt/local/lib/libSM.dylib
/opt/local/lib/libICE.dylib
/opt/local/lib/libXext.dylib
/opt/local/lib/libX11.dylib
/opt/local/lib/libXrender.dylib
/opt/local/lib/libXft.dylib
/opt/local/lib/libxml2.dylib
/usr/lib/libresolv.dylib
/opt/local/lib/libncurses.dylib
/opt/local/lib/libfreetype.dylib
/opt/local/lib/libfontconfig.dylib
/System/Library/Frameworks//CoreServices.framework/CoreServices
/System/Library/Frameworks//ApplicationServices.framework/ApplicationServices
/opt/local/lib/libz.dylib
/opt/local/lib/libotf.dylib
/usr/lib/libpthread.dylib
/usr/lib/libgcc_s.10.4.dylib
/opt/local/lib/apple-gcc42/gcc/powerpc-apple-darwin8/4.2.1/libgcc.a
/usr/lib/libSystemStubs.a
/usr/lib/libSystem.dylib
/opt/local/lib/libiconv.2.dylib
/opt/local/lib/libexpat.1.dylib
/opt/local/lib/libbz2.1.0.dylib
/opt/local/lib/libxcb.1.dylib
/opt/local/lib/libXau.6.dylib
/opt/local/lib/libXdmcp.6.dylib
/usr/lib/system/libmathCommon.A.dylib
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/WebServicesCore.framework/Versions/A/WebServicesCore
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/FindByContent.framework/Versions/A/FindByContent
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
/usr/lib/libcrypto.0.9.7.dylib
/System/Library/Frameworks//IOKit.framework/IOKit
/System/Library/Frameworks//Security.framework/Security
/System/Library/Frameworks//SystemConfiguration.framework/SystemConfiguration
/usr/lib/libicucore.A.dylib
/usr/lib/libauto.dylib
/usr/lib/libobjc.A.dylib
/usr/lib/libcups.2.dylib
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRaw.dylib
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
/opt/local/lib/libxml2.2.dylib
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
/System/Library/Frameworks//Accelerate.framework/Accelerate
/opt/local/lib/libz.1.dylib
/System/Library/Frameworks//DiskArbitration.framework/DiskArbitration
/usr/lib/libbsm.dylib
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
/System/Library/Frameworks//vecLib.framework/vecLib
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
/opt/local/lib/apple-gcc42/gcc/powerpc-apple-darwin8/4.2.1/libgcc.a(_eprintf.o)
../lib/libgnu.a(pthread_sigmask.o)
../lib/libgnu.a(lstat.o)
../lib/libgnu.a(stat.o)
../lib/libgnu.a(careadlinkat.o)
../lib/libgnu.a(readlink.o)
../lib/libgnu.a(allocator.o)
/opt/local/lib/apple-gcc42/gcc/powerpc-apple-darwin8/4.2.1/libgcc.a(_floatundidf.o)
../lwlib/liblw.a(lwlib.o)
../lwlib/liblw.a(lwlib-Xlw.o)
../lwlib/liblw.a(xlwmenu.o)
../lwlib/liblw.a(lwlib-Xaw.o)
../lib/libgnu.a(dtoastr.o)
/opt/local/lib/apple-gcc42/gcc/powerpc-apple-darwin8/4.2.1/libgcc.a(darwin-world.o)
../lwlib/liblw.a(lwlib-utils.o)
../lib/libgnu.a(symlink.o)
../lib/libgnu.a(sha1.o)
../lib/libgnu.a(sha256.o)
../lib/libgnu.a(sha512.o)
../lib/libgnu.a(md5.o)
../lib/libgnu.a(filemode.o)
../lib/libgnu.a(strftime.o)
@(#)PROGRAM:ld  PROJECT:ld64-85.2.1
Library search paths:
	/opt/local/lib
	/opt/local/lib
	/opt/local/lib
	/opt/local/lib
	/opt/local/lib
	/opt/local/lib
	/opt/local/lib
	/opt/local/lib/apple-gcc42/gcc/powerpc-apple-darwin8/4.2.1
	/opt/local/lib/apple-gcc42
	/usr/lib
	/usr/local/lib
Framework search paths:
	/Library/Frameworks/
	/System/Library/Frameworks/
ld warning: duplicate dylib /opt/local/lib/libxml2.2.dylib
ld warning: duplicate dylib /opt/local/lib/libz.1.dylib
cd ../lisp; make -k update-subdirs

They are loaded twice but appear only once on the command line.

With the default 32-bit Lisp integers both the X11 client and the NS variant of GNU Emacs work quite well, no early crashes.

comment:4 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Interestingly compilation without Mac OS X frameworks succeeds without -faltivec

That' would be expected because it wouldn't be pulling in the buggy header.

in the end ld reports a strange problem with "duplicate dylibs":

That ld warning is benign, and I think it only appears because you are running verbosely.

comment:5 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: newclosed

comment:6 in reply to:  2 ; Changed 13 years ago by ballapete (Peter "Pete" Dyballa)

Replying to jeremyhu@…:

The linker being used should be /opt/local/bin/ld which should support the flag. What version of the ld64 port do you have installed?

It seems that ld64 @85.2.1_5 only supports -pie. This is mentioned in the man page.

comment:7 in reply to:  6 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Replying to Peter_Dyballa@…:

Replying to jeremyhu@…:

The linker being used should be /opt/local/bin/ld which should support the flag. What version of the ld64 port do you have installed?

It seems that ld64 @85.2.1_5 only supports -pie. This is mentioned in the man page.

Yes, hence the change that I referenced in the comment immediately before yours...

Note: See TracTickets for help on using tickets.