Closed Bug 199134 Opened 21 years ago Closed 21 years ago

build failed shlibsign on FreeBSD 4.7-RELEASE. maybe '-pthread -lsoftokn3' is required

Categories

(NSS :: Build, defect, P2)

x86
FreeBSD
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: matsu, Assigned: wtc)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4a) Gecko/20030311
Build Identifier: mozilla-source.tar.gz 24-Mar-2003 14:31

I build FreeBSD nightly build every day.
But building mozilla is failed on FreeBSD 4.7-RELEASE
since few days ago.

   % env MOZILLA_OFFICIAL=1 BUILD_OFFICIAL=1 \
     GLIB_CONFIG=/usr/local/bin/glib12-config \
     GTK_CONFIG=/usr/X11R6/bin/gtk12-config \
     LIBIDL_CONFIG=/usr/local/bin/libIDL-config-2 \
     gmake -f client.mk build
   (snip)
   gmake[4]: Entering directory `/ide3/mozilla/mozilla/security/nss/cmd/shlibsign'
   cd mangle; gmake -j1 export
   gmake[5]: Entering directory
`/ide3/mozilla/mozilla/security/nss/cmd/shlibsign/mangle'
   gmake[5]: Nothing to be done for `export'.
   gmake[5]: Leaving directory
`/ide3/mozilla/mozilla/security/nss/cmd/shlibsign/mangle'
   Tue Mar 25 22:29:29 JST 2003
   gcc -o FreeBSD4.7_OPT.OBJ/shlibsign -O -fPIC -ansi -Wall -DFREEBSD
-DHAVE_STRERROR \
    -DHAVE_BSD_FLOCK -DXP_UNIX -DSHLIB_SUFFIX=\"so\" -DSHLIB_PREFIX=\"lib\"
-UDEBUG -DNDEBUG \
    -D_THREAD_SAFE -D_REENTRANT -I/usr/X11R6/include
-I/ide3/mozilla/mozilla/dist/include  \
    -I../../../../dist/public/nss -I../../../../dist/private/nss
-I../../../../dist/include \
    -I/ide3/mozilla/mozilla/dist/include/nspr
-I/ide3/mozilla/mozilla/dist/include/dbm \
    -I../../../../dist/public/dbm -I../../../../dist/public/seccmd 
FreeBSD4.7_OPT.OBJ/shlibsign.o \
    /ide3/mozilla/mozilla/dist/lib/libsectool.a 
-L/ide3/mozilla/mozilla/dist/lib/ -lssl3 -lsmime3 \
    -lnss3 -lplc4 -lplds4 -lnspr4
   /usr/libexec/elf/ld: warning: libsoftokn3.so, needed by
/ide3/mozilla/mozilla/dist/lib//libnss3.so, not found (try using -rpath or
-rpath-link)
   /ide3/mozilla/mozilla/dist/lib//libnspr4.so: undefined reference to
`pthread_cond_signal'
   (snip)
   /ide3/mozilla/mozilla/dist/lib//libnss3.so: undefined reference to
`NSC_GetFunctionList'
   (snip)
   gmake[4]: *** [FreeBSD4.7_OPT.OBJ/shlibsign] Error 1
   gmake[4]: Leaving directory `/ide3/mozilla/mozilla/security/nss/cmd/shlibsign'

It seems lack of '-pthread -lsoftokn3'.

After failing build, run gmake with "LDFLAGS+='-pthread -lsoftokn3'" is succeed.

   % cd /ide3/mozilla/mozilla/security/nss
   % gmake -C ../../security/nss/cmd/shlibsign MAKE="gmake -j1" -j1 \
    MOZILLA_INCLUDES="-I/ide3/mozilla/mozilla/dist/include/nspr
-I/ide3/mozilla/mozilla/dist/include/dbm" \
    SOURCE_MD_DIR=/ide3/mozilla/mozilla/dist DIST=/ide3/mozilla/mozilla/dist
MOZILLA_CLIENT=1 NO_MDUPDATE=1 \
    BUILD_OPT=1 NS_USE_GCC=1 NS_USE_NATIVE= LDFLAGS+='-pthread -lsoftokn3'

But, I can't make suitable patch.


Reproducible: Always

Steps to Reproduce:
% fetch http://ftp.mozilla.org/pub/mozilla/nightly/latest/mozilla-source.tar.bz2
% tar yxf mozilla-source.tar.bz2
% cd mozilla
% cat > .mozconfig <<EOF
ac_add_options --enable-optimize="-O"
ac_add_options --disable-debug
ac_add_options --enable-strip
ac_add_options --disable-tests
ac_add_options --enable-crypto
ac_add_options --enable-extensions=default,irc
ac_add_options --with-pthreads
EOF
% env MOZILLA_OFFICIAL=1 BUILD_OFFICIAL=1 \
  GLIB_CONFIG=/usr/local/bin/glib12-config \
  GTK_CONFIG=/usr/X11R6/bin/gtk12-config \
  LIBIDL_CONFIG=/usr/local/bin/libIDL-config-2 \
  gmake -f client.mk build
.
Assignee: seawood → wtc
Component: Build Config → Build
Product: Browser → NSS
QA Contact: granrose → wtc
Version: Trunk → unspecified
Attached patch Proposed patchSplinter Review
Thank you for the bug report.

Could you try this patch?  After you apply this patch,
cd to the security/manager directory in your build tree
and do "make clean".  Then build mozilla.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P2
Target Milestone: --- → 3.8
Applying your patch, it succeeded to build.
Thanks!

Comment on attachment 118513 [details] [diff] [review]
Proposed patch

Mr. Matsumura, could you post the output of the following commands?

    % `gcc -print-prog-name=ld` -v
    % ld -v

Could you also look in the build output and look for the command
that built shlibsign?  It should begin with:

    gcc -o FreeBSD4.7_OPT.OBJ/shlibsign ...

cls, could you review this patch?  It has two changes.
1. Add -pthread to OS_LIBS.  Note that -pthread is a linker flag
(or rather a gcc flag used only for linking) on FreeBSD.
2. Use the -rpath-link flag to instruct the linker where to find
-lsoftokn3, an implicitly dependency of -lnss3.  We do not want to
link with -lsoftokn3 explicitly because the fact that -lnss3
depends on -lsoftokn3 is an implementation detail.  This -rpath-link
flag is needed for GNU ld and I plan to replace the similar changes
for Linux, BSD/OS, FreeBSD, and Solaris/GCC_USE_GNU_LD by a test for
GNU ld.
Attachment #118513 - Flags: review?(seawood)
% `gcc -print-prog-name=ld` -v
GNU ld version 2.12.1 [FreeBSD] 2002-07-20
% ld -v
GNU ld version 2.12.1 [FreeBSD] 2002-07-20

before apply a patch:
gcc -o FreeBSD4.7_OPT.OBJ/shlibsign -O -fPIC -ansi -Wall -DFREEBSD
-DHAVE_STRERROR -DHAVE_BSD_FLOCK -DXP_UNIX -DSHLIB_SUFFIX=\"so\"
-DSHLIB_PREFIX=\"lib\" -UDEBUG -DNDEBUG -D_THREAD_SAFE -D_REENTRANT
-I/usr/X11R6/include -I/ide3/mozilla/mozilla/dist/include 
-I../../../../dist/public/nss -I../../../../dist/private/nss
-I../../../../dist/include -I/ide3/mozilla/mozilla/dist/include/nspr
-I/ide3/mozilla/mozilla/dist/include/dbm -I../../../../dist/public/dbm
-I../../../../dist/public/seccmd  FreeBSD4.7_OPT.OBJ/shlibsign.o 
/ide3/mozilla/mozilla/dist/lib/libsectool.a  -L/ide3/mozilla/mozilla/dist/lib/
-lssl3 -lsmime3 -lnss3 -lplc4 -lplds4 -lnspr4  


after apply a patch:
gcc -o FreeBSD4.7_OPT.OBJ/shlibsign -O -fPIC -ansi -Wall -DFREEBSD
-DHAVE_STRERROR -DHAVE_BSD_FLOCK -DXP_UNIX -DSHLIB_SUFFIX=\"so\"
-DSHLIB_PREFIX=\"lib\" -UDEBUG -DNDEBUG -D_THREAD_SAFE -D_REENTRANT
-I/usr/X11R6/include -I/ide3/mozilla/mozilla/dist/include 
-I../../../../dist/public/nss -I../../../../dist/private/nss
-I../../../../dist/include -I/ide3/mozilla/mozilla/dist/include/nspr
-I/ide3/mozilla/mozilla/dist/include/dbm -I../../../../dist/public/dbm
-I../../../../dist/public/seccmd  FreeBSD4.7_OPT.OBJ/shlibsign.o 
/ide3/mozilla/mozilla/dist/lib/libsectool.a 
-Wl,-rpath-link,/ide3/mozilla/mozilla/dist/lib -L/ide3/mozilla/mozilla/dist/lib/
-lssl3 -lsmime3 -lnss3 -lplc4 -lplds4 -lnspr4  -pthread
Comment on attachment 118513 [details] [diff] [review]
Proposed patch

r=cls
Attachment #118513 - Flags: review?(seawood) → review+
Comment on attachment 118513 [details] [diff] [review]
Proposed patch

Requesting mozilla 1.4a approval.  This patch fixes a build
failure in NSS on FreeBSD.
Attachment #118513 - Flags: approval1.4a?
Attachment #118513 - Flags: approval1.4a? → approval1.4a+
Patch checked into the NSS TIP (NSS 3.8) and the NSS_CLIENT_TAG
(mozilla 1.4alpha).
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: