зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
7e6a8e4168
Коммит
47c8a2f084
|
@ -73,8 +73,6 @@ else
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LD=/usr/ccs/bin/ld
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# The default implementation strategy for Solaris is classic nspr.
|
# The default implementation strategy for Solaris is classic nspr.
|
||||||
#
|
#
|
||||||
|
@ -132,10 +130,23 @@ endif
|
||||||
# Purify doesn't like -MDupdate
|
# Purify doesn't like -MDupdate
|
||||||
NOMD_OS_CFLAGS += $(DSO_CFLAGS) $(OS_DEFINES) $(SOL_CFLAGS)
|
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 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)
|
MKSHLIB += -M $(MAPFILE)
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
|
PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
|
||||||
sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
|
sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
|
||||||
|
|
||||||
|
@ -145,7 +156,11 @@ PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
|
||||||
# ld options:
|
# ld options:
|
||||||
# -G: produce a shared object
|
# -G: produce a shared object
|
||||||
# -z defs: no unresolved symbols allowed
|
# -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.
|
# -KPIC generates position independent code for use in shared libraries.
|
||||||
# (Similarly for -fPIC in case of gcc.)
|
# (Similarly for -fPIC in case of gcc.)
|
||||||
|
|
|
@ -192,7 +192,9 @@ endif
|
||||||
# Use the Solaris ld, which knows where to find libsoftokn3.so.
|
# Use the Solaris ld, which knows where to find libsoftokn3.so.
|
||||||
ifeq ($(OS_ARCH), SunOS)
|
ifeq ($(OS_ARCH), SunOS)
|
||||||
ifdef NS_USE_GCC
|
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
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -165,8 +165,11 @@ endif
|
||||||
ifeq ($(SYSV_SPARC),1)
|
ifeq ($(SYSV_SPARC),1)
|
||||||
SOLARIS_AS = /usr/ccs/bin/as
|
SOLARIS_AS = /usr/ccs/bin/as
|
||||||
ifdef NS_USE_GCC
|
ifdef NS_USE_GCC
|
||||||
LD = gcc
|
ifdef GCC_USE_GNU_LD
|
||||||
DSO_LDOPTS = -B/usr/ccs/bin/ -shared -h,$(notdir $@) -Wl,-B,symbolic,-z,defs,-z,now,-z,text,-M,mapfile.Solaris
|
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
|
else
|
||||||
MKSHLIB += -B symbolic -z defs -z now -z text -M mapfile.Solaris
|
MKSHLIB += -B symbolic -z defs -z now -z text -M mapfile.Solaris
|
||||||
endif
|
endif
|
||||||
|
|
Загрузка…
Ссылка в новой задаче