Bugzilla 198481: fixed all build problems with gcc on Solaris.

1. Removed the workarounds we put in before -- hardcoding LD to
/usr/ccs/bin/ld and passing the -B/usr/ccs/bin/ flag to gcc.
2. Use the compiler, $(CC), to build shared libraries.
3. If gcc is used, determine whether gcc uses GNU ld or Solaris
ld and set the new make variable GCC_USE_GNU_LD accordingly.
Modified Files:
	coreconf/SunOS5.mk nss/cmd/platlibs.mk nss/lib/freebl/Makefile
This commit is contained in:
wtc%netscape.com 2003-03-21 03:31:00 +00:00
Родитель 7e6a8e4168
Коммит 47c8a2f084
3 изменённых файлов: 27 добавлений и 7 удалений

Просмотреть файл

@ -73,8 +73,6 @@ else
endif
endif
LD=/usr/ccs/bin/ld
#
# The default implementation strategy for Solaris is classic nspr.
#
@ -132,10 +130,23 @@ endif
# Purify doesn't like -MDupdate
NOMD_OS_CFLAGS += $(DSO_CFLAGS) $(OS_DEFINES) $(SOL_CFLAGS)
MKSHLIB = $(LD) $(DSO_LDOPTS)
MKSHLIB = $(CC) $(DSO_LDOPTS)
ifdef NS_USE_GCC
ifeq (GNU,$(findstring GNU,$(shell `$(CC) -print-prog-name=ld` -v 2>&1)))
GCC_USE_GNU_LD = 1
endif
endif
ifdef MAPFILE
ifdef NS_USE_GCC
ifdef GCC_USE_GNU_LD
MKSHLIB += -Wl,--version-script,$(MAPFILE)
else
MKSHLIB += -Wl,-M,$(MAPFILE)
endif
else
MKSHLIB += -M $(MAPFILE)
endif
endif
PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
@ -145,7 +156,11 @@ PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
# ld options:
# -G: produce a shared object
# -z defs: no unresolved symbols allowed
DSO_LDOPTS += -G -h $(notdir $@)
ifdef NS_USE_GCC
DSO_LDOPTS += -shared -h $(notdir $@)
else
DSO_LDOPTS += -G -h $(notdir $@)
endif
# -KPIC generates position independent code for use in shared libraries.
# (Similarly for -fPIC in case of gcc.)

Просмотреть файл

@ -192,7 +192,9 @@ endif
# Use the Solaris ld, which knows where to find libsoftokn3.so.
ifeq ($(OS_ARCH), SunOS)
ifdef NS_USE_GCC
EXTRA_SHARED_LIBS += -B/usr/ccs/bin/
ifdef GCC_USE_GNU_LD
EXTRA_SHARED_LIBS += -Wl,-rpath-link,$(DIST)/lib
endif
endif
endif

Просмотреть файл

@ -165,8 +165,11 @@ endif
ifeq ($(SYSV_SPARC),1)
SOLARIS_AS = /usr/ccs/bin/as
ifdef NS_USE_GCC
LD = gcc
DSO_LDOPTS = -B/usr/ccs/bin/ -shared -h,$(notdir $@) -Wl,-B,symbolic,-z,defs,-z,now,-z,text,-M,mapfile.Solaris
ifdef GCC_USE_GNU_LD
MKSHLIB += -Wl,-Bsymbolic,-z,defs,-z,now,-z,text,--version-script,mapfile.Solaris
else
MKSHLIB += -Wl,-B,symbolic,-z,defs,-z,now,-z,text,-M,mapfile.Solaris
endif
else
MKSHLIB += -B symbolic -z defs -z now -z text -M mapfile.Solaris
endif