Last Comment Bug 403250 - [10.5] 1.8 build configured with --enable-strip fails: strip: symbols referenced by relocation entries that can't be stripped in: .../xpinstall/src/libxpinstall.dylib
: [10.5] 1.8 build configured with --enable-strip fails: strip: symbols referen...
Status: RESOLVED FIXED
: fixed1.8.1.12
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: 1.8 Branch
: All Mac OS X
: -- normal (vote)
: ---
Assigned To: Mark Mentovai
:
: Gregory Szorc [:gps]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-09 13:48 PST by Mark Mentovai
Modified: 2007-12-18 13:33 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Always use ld -exported_symbols_list, never use nmedit -s (2.68 KB, patch)
2007-11-09 14:26 PST, Mark Mentovai
ted: review+
dsicore: approval1.9+
Details | Diff | Splinter Review
1.8 branch version (2.89 KB, patch)
2007-11-09 14:28 PST, Mark Mentovai
ted: review+
dveditz: approval1.8.1.12+
Details | Diff | Splinter Review

Description Mark Mentovai 2007-11-09 13:48:23 PST
While building Camino configured with --enable-strip:

rm -f libxpinstall.dylib
c++ -I/usr/X11/include -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fpascal-strings -no-cpp-precomp -fno-common -fshort-wchar -I/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon -pipe  -DNDEBUG -DTRIMMED -O2 -march=nocona -pipe -fPIC  -o libxpinstall.dylib  CertReader.o nsInstall.o nsInstallTrigger.o nsInstallVersion.o nsInstallFolder.o nsJSInstall.o nsJSFile.o nsJSInstallTriggerGlobal.o nsJSInstallVersion.o nsSoftwareUpdate.o nsSoftwareUpdateRun.o nsInstallFile.o nsInstallExecute.o nsInstallPatch.o nsInstallUninstall.o nsInstallResources.o nsRegisterItem.o nsTopProgressNotifier.o nsLoggingProgressNotifier.o ScheduledTasks.o nsXPIProxy.o nsXPITriggerInfo.o nsXPInstallManager.o nsInstallFileOpItem.o nsJSFileSpecObj.o nsInstallLogComment.o nsInstallBitwise.o nsAppleSingleDecoder.o       -L../../dist/bin -L../../dist/lib  -L../../dist/bin -lmozjs -L../../dist/bin -lxpcom -lxpcom_core -L../../dist/bin -L../../dist/lib -lplds4 -lplc4 -lnspr4 ../../dist/lib/libunicharutil_s.a -L../../dist/lib -lmozz -L../../dist/lib -lxpcom_compat  -framework Carbon  -bundle    
chmod +x libxpinstall.dylib
nmedit -s /lizard/1.8/mozilla/build/unix/gnu-ld-scripts/components-export-list libxpinstall.dylib
nmedit: can't make global coalesced symbols (like __ZTC26nsRandomAccessOutputStream0_25nsRandomAccessStoreClient) into static symbols (use ld(1)'s -exported_symbols_list option) in a final linked image: /lizard/1.8/build/km/xpinstall/src/libxpinstall.dylib
strip -x -S libxpinstall.dylib
strip: symbols referenced by relocation entries that can't be stripped in: /lizard/1.8/build/km/xpinstall/src/libxpinstall.dylib
__ZN12nsFileClientD0Ev
__ZN12nsFileClientD1Ev
__ZN15nsInstallObjectD0Ev
__ZN15nsInstallObjectD1Ev
__ZN18nsShutdownObserverD0Ev
__ZN18nsShutdownObserverD1Ev
__ZN25nsRandomAccessStoreClient10set_at_eofEi
__ZN25nsRandomAccessStoreClientD0Ev
__ZN25nsRandomAccessStoreClientD1Ev
__ZN26nsRandomAccessOutputStreamD0Ev
__ZN26nsRandomAccessOutputStreamD1Ev
__ZN9nsVoidKeyD0Ev
__ZN9nsVoidKeyD1Ev
__ZNK25nsRandomAccessStoreClient10get_at_eofEv
__ZNK9nsVoidKey5CloneEv
__ZNK9nsVoidKey6EqualsEPK9nsHashKey
__ZNK9nsVoidKey8HashCodeEv
__ZThn8_N26nsRandomAccessOutputStreamD0Ev
__ZThn8_N26nsRandomAccessOutputStreamD1Ev
make[4]: *** [libxpinstall.dylib] Error 1
make[4]: *** Deleting file `libxpinstall.dylib'
make[4]: Leaving directory `/lizard/1.8/build/km/xpinstall/src'
make[3]: *** [libs] Error 2
make[3]: Leaving directory `/lizard/1.8/build/km/xpinstall'
make[2]: *** [tier_50] Error 2
make[2]: Leaving directory `/lizard/1.8/build/km'
make[1]: *** [alldep] Error 2
make[1]: Leaving directory `/lizard/1.8/build/km'
make: *** [alldep] Error 2
make: Leaving directory `/lizard/1.8/mozilla'
Comment 1 Mark Mentovai 2007-11-09 14:26:43 PST
Created attachment 288054 [details] [diff] [review]
Always use ld -exported_symbols_list, never use nmedit -s

The nmedit warning here was helpful:

nmedit: can't make global coalesced symbols (like __ZTC26nsRandomAccessOutputStream0_25nsRandomAccessStoreClient) into static symbols (use ld(1)'s -exported_symbols_list option) in a final linked image: /lizard/1.8/build/km/xpinstall/src/libxpinstall.dylib

nmedit was failing to thin out the symbol table.  We actually do support using ld -exported_symbols_list and are supposed to use it whenever it's available in ld.  However, our configure check intended to determine whether the ld option is available didn't work under Leopard, because Leopard's ld messages changed.  Currently, we test for the option by running "ld -exported_symbols_list" and looking for "argument missing".

mark@tiger bash$ ld -exported_symbols_list
ld: -exported_symbols_list: argument missing
mark@leopard bash$ ld -exported_symbols_list
ld: can't open -exported_symbols_list file: (null)

Because the -exported_symbols_list was introduced to Apple ld in December 2002 (a Jaguar (10.2) Developer Tools release), and our minimum build requirement even on the 1.8 branch is 10.3 where all versions of ld support this option, there is no reason to even continue performing this check.  We should assume that the option exists in ld and use it outright.
Comment 2 Mark Mentovai 2007-11-09 14:28:57 PST
Created attachment 288055 [details] [diff] [review]
1.8 branch version

On all currently-supported build systems (running Tiger and Panther), the configure check always passes, resulting in MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS being set and nmedit never being used.  This patch is a no-op on those platforms.  It's required to bring the build on Leopard in line with earlier releases.

We'd like to take this patch on the 1.8 branch because that branch is still used for active Camino development, and our developers are moving to Leopard.
Comment 3 Mark Mentovai 2007-11-09 14:51:15 PST
See also bug 403258.
Comment 4 Ted Mielczarek [:ted.mielczarek] 2007-11-15 17:10:12 PST
Comment on attachment 288054 [details] [diff] [review]
Always use ld -exported_symbols_list, never use nmedit -s

r=me Sorry for the delay!
Comment 5 Mark Mentovai 2007-11-29 11:11:26 PST
Comment on attachment 288054 [details] [diff] [review]
Always use ld -exported_symbols_list, never use nmedit -s

Needed for Leopard build compatibility.
Comment 6 Mark Mentovai 2007-11-30 12:36:22 PST
Checked in on the trunk.
Comment 7 Daniel Veditz [:dveditz] 2007-12-17 15:57:11 PST
Comment on attachment 288055 [details] [diff] [review]
1.8 branch version

approved for 1.8.1.12, a=dveditz for release-drivers

Please land ASAP so we can validate this doesn't break our builds
Comment 8 Mark Mentovai 2007-12-18 13:33:26 PST
Checked in on MOZILLA_1_8_BRANCH for 1.8.1.12.

Note You need to log in before you can comment on or make changes to this bug.