Skip to content

Commit

Permalink
OS-1639 illumos-extra should build with -zassert-deflib
Browse files Browse the repository at this point in the history
OS-1640 illumos-extra is missing some dependencies
OS-1641 1-extra-stamp build erroneously uses bootstrap build
  • Loading branch information
rmustacc committed Oct 23, 2012
1 parent a9d0a82 commit 6938e49
Show file tree
Hide file tree
Showing 12 changed files with 103 additions and 33 deletions.
16 changes: 12 additions & 4 deletions Makefile
Expand Up @@ -93,7 +93,9 @@ strap: $(STRAP_SUBDIRS)

curl: libz openssl
gzip: libz
node.js: openssl
node.js: openssl libm
ncurses: libm
dialog: ncurses

#
# pkg-config may be installed. This will actually only hurt us rather than help
Expand All @@ -106,16 +108,22 @@ node.js: openssl

$(DESTDIR)/usr/gnu/bin/gas: FRC
(cd binutils && \
PKG_CONFIG_LIBDIR="" $(MAKE) DESTDIR=$(DESTDIR) install)
PKG_CONFIG_LIBDIR="" \
STRAP=$(STRAP) \
$(MAKE) DESTDIR=$(DESTDIR) install)


$(DESTDIR)/usr/bin/gcc: $(DESTDIR)/usr/gnu/bin/gas
(cd gcc4 && \
PKG_CONFIG_LIBDIR="" $(MAKE) DESTDIR=$(DESTDIR) install)
PKG_CONFIG_LIBDIR="" \
STRAP=$(STRAP) \
$(MAKE) DESTDIR=$(DESTDIR) install)

$(SUBDIRS): $(DESTDIR)/usr/bin/gcc
(cd $@ && \
PKG_CONFIG_LIBDIR="" $(MAKE) DESTDIR=$(DESTDIR) install)
PKG_CONFIG_LIBDIR="" \
STRAP=$(STRAP) \
$(MAKE) DESTDIR=$(DESTDIR) install)

install: $(SUBDIRS) gcc4 binutils

Expand Down
18 changes: 14 additions & 4 deletions Makefile.defs
Expand Up @@ -23,8 +23,8 @@

BASE = $(PWD)
DESTDIR = $(BASE)/../proto
VER.32 = $(VER)-32
VER.64 = $(VER)-64
VER.32 = $(VER)-32$(STRAP)
VER.64 = $(VER)-64$(STRAP)

PATH = $(DESTDIR)/usr/bin:/usr/bin:/usr/sbin:/sbin:/opt/local/bin

Expand All @@ -43,8 +43,18 @@ BUILD32 = yes
BUILD64 =

CPPFLAGS = $(SYSINCDIRS:%=-isystem $(DESTDIR)/%)
LDFLAGS = $(SYSLIBDIRS:%=-L$(DESTDIR)/%)
LDFLAGS.64 = $(SYSLIBDIRS:%=-L$(DESTDIR)/%/64)

#
# Because of bugs in ntp, we need to be able to refer to the target specific
# flags as well as the generic flags later on.
#
ifneq ($(STRAP),strap)
GENLDFLAGS = -Wl,-zassert-deflib -Wl,-zfatal-warnings
endif
T32_LDFLAGS = $(SYSLIBDIRS:%=-L$(DESTDIR)/%)
T64_LDFLAGS = $(SYSLIBDIRS:%=-L$(DESTDIR)/%/64)
LDFLAGS = $(T32_LDFLAGS) $(GENLDFLAGS)
LDFLAGS.64 = $(T64_LDFLAGS) $(GENLDFLAGS)

AUTOCONF_CC = CC="$(GCC)"
AUTOCONF_CXX = CXX="$(GXX)"
Expand Down
3 changes: 2 additions & 1 deletion Makefile.targ
Expand Up @@ -76,4 +76,5 @@ $(VER.64)/$(UNPACK_SENTINEL): $(TARBALL)
touch $(VER.64)/$(UNPACK_SENTINEL)

clean:
-rm -rf $(VER) $(VER.32) $(VER.64) .unpack32 .unpack64 $(CLEANFILES)
-rm -rf $(VER) $(VER.32) $(VER.64) .unpack32 .unpack64 $(CLEANFILES) \
$(VER.32)strap $(VER.64)strap
2 changes: 1 addition & 1 deletion binutils/Makefile
Expand Up @@ -32,7 +32,7 @@ AUTOCONF_OPTS = \
--enable-64-bit-bfd \
--program-prefix=g

AUTOCONF_ENV = \
AUTOCONF_ENV += \
CC=gcc \
CXX=g++ \
DESTDIR=$(DESTDIR) \
Expand Down
13 changes: 9 additions & 4 deletions bzip2/Makefile
Expand Up @@ -22,14 +22,15 @@
# Copyright (c) 2012, Joyent Inc. All rights reserved.
#

VER = bzip2-1.0.6
BVER = bzip2-1.0.6
VER = $(BVER)$(STRAP)

include ../Makefile.defs

OVERRIDES += CC="$(GCC)"
OVERRIDES.64 += CC="$(GCC.64)"

CLEANFILES += bzgrep.tmp
CLEANFILES += bzgrep.tmp $(VER)strap

include ../Makefile.targ

Expand All @@ -46,8 +47,12 @@ all_64: $(VER)/amd64/Makefile
install: all
/usr/bin/ksh93 ./install-bzip2 $(PWD)/$(VER)

$(VER)/Makefile.dist: $(VER).tar.gz
gzip -dc $(VER).tar.gz | tar xopf -
$(VER)/Makefile.dist: $(BVER).tar.gz
-rm -rf $(VER)
mkdir -p .unpack
gtar x -C .unpack -z --no-same-owner -f $(BVER).tar.gz
mv -f .unpack/$(BVER) $(VER)
-rmdir .unpack
(cd $(VER); gpatch -p1 < ../bzip2.patch)
cp $(VER)/Makefile $(VER)/Makefile.dist

Expand Down
8 changes: 7 additions & 1 deletion bzip2/Makefile.com
Expand Up @@ -45,10 +45,16 @@ bzip2recover_OBJECTS = \
LDFLAGS += -Wl,-Bdirect -Wl,-zdefs -Wl,-ztext -Wl,-zcombreloc
LDFLAGS += -Wl,-M../../mapfile -Wl,-h,$(DYNLIB)
LDFLAGS += -L. -L$(DESTDIR)/usr/lib -L$(DESTDIR)/lib
ifneq ($(STRAP),strap)
LDFLAGS += $(GENLDFLAGS)
endif
LDLIBS += -lc

PROGS = bzip2 bzip2recover
PROG_LDFLAGS += -Wl,-Bdirect -L.
PROG_LDFLAGS += -Wl,-Bdirect -L.
ifneq ($(STRAP),strap)
PROG_LDFLAGS += $(GENLDFLAGS)
endif
bzip2_LDLIBS += -lbz2

# --- Generic ---
Expand Down
23 changes: 17 additions & 6 deletions cpp/Makefile
Expand Up @@ -23,15 +23,15 @@

include ../Makefile.defs

PROG = cpp
PROG = cpp$(STRAP)
PROGDIR = /usr/lib

OBJS = \
cpp.o \
y.tab.o
cpp.o$(STRAP) \
y.tab.o$(STRAP)

CLEANFILES += \
y.tab.c
y.tab.c$(STRAP)

CFLAGS += -O2
LD = $(GCC)
Expand All @@ -45,17 +45,28 @@ all: $(PROG)
install: $(PROTOFILES)

clean:
-rm -f $(OBJS) $(CLEANFILES) $(PROG)
-rm -f $(OBJS) $(CLEANFILES) $(PROG) *strap

$(PROG): $(OBJS)
$(LINK.prog)

%.o: %.c
%.o$(STRAP): %.c
$(COMPILE.c)

#
# We need to distinguish between the cpp build in the bootstrap and the cpp
# built normally. However, when we install it, they need to have the same name.
# To handle this we add a small bit of shell logic. Note that the mv bit is
# explicitly ignored and instead we do a final check to make sure we have
# something called cpp at the very end which will either be because of install
# or because of the later mv.
#
$(DESTDIR)$(PROGDIR)/%: %
mkdir -p $(DESTDIR)$(PROGDIR)
/usr/sbin/install -m 0755 -f $(DESTDIR)$(PROGDIR) $(PROG)
-[ "$(PROG)" == "cppstrap" ] && mv -f $(DESTDIR)$(PROGDIR)/$(PROG) \
$(DESTDIR)$(PROGDIR)/cpp
[ -f "$(DESTDIR)$(PROGDIR)/cpp" ]

y.tab.c: cpy.y
$(YACC) cpy.y
20 changes: 12 additions & 8 deletions libxml/Makefile
Expand Up @@ -30,10 +30,14 @@
# build system.
#

VER=libxml2-2.7.6
BVER=libxml2-2.7.6
VER=$(BVER)$(STRAP)
VER64=$(VER)-64

LDFLAGS= -z defs -z text -z combreloc -lpthread -lc -nodefaultlibs
ifneq ($(STRAP),strap)
LDFLAGS += $(GENLDFLAGS)
endif
LARGEFILES= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
-fno-builtin

Expand Down Expand Up @@ -101,15 +105,15 @@ $(VER64)/config.status: $(VER64)/configure
cp mapfile $(VER64)/libxml2.syms
patch -N $(VER64)/libtool < libtool.patch

$(VER)/configure: $(VER).tar.gz
mkdir -p tmp; gzip -dc $(VER).tar.gz | (cd tmp; tar xopf -)
mv tmp/$(VER) $(VER); rmdir tmp
$(VER)/configure: $(BVER).tar.gz
mkdir -p tmp; gzip -dc $(BVER).tar.gz | (cd tmp; tar xopf -)
mv tmp/$(BVER) $(VER); rmdir tmp
touch $(VER)/configure

$(VER64)/configure: $(VER).tar.gz
mkdir -p tmp; gzip -dc $(VER).tar.gz | (cd tmp; tar xopf -)
mv tmp/$(VER) $(VER64); rmdir tmp
$(VER64)/configure: $(BVER).tar.gz
mkdir -p tmp; gzip -dc $(BVER).tar.gz | (cd tmp; tar xopf -)
mv tmp/$(BVER) $(VER64); rmdir tmp
touch $(VER64)/configure

clean:
-rm -rf $(VER) $(VER64)
-rm -rf $(VER) $(VER64) $(VER)strap $(VER64)strap
4 changes: 4 additions & 0 deletions libz/Makefile
Expand Up @@ -55,6 +55,10 @@ LDSHARED_FLAGS = \
-Wl,-zcombreloc \
-Wl,-M,../mapfile

ifneq ($(STRAP),strap)
LDSHARED_FLAGS += $(GENLDFLAGS)
endif

LDSHARED_FLAGS.32 = $(LDSHARED_FLAGS) $(SYSLIBDIRS:%=-L$(DESTDIR)/%)
LDSHARED_FLAGS.64 = $(LDSHARED_FLAGS) $(SYSLIBDIRS:%=-L$(DESTDIR)/%/64)
LDSHARED_LIBS = -lc
Expand Down
14 changes: 14 additions & 0 deletions ntp/Makefile
Expand Up @@ -46,6 +46,20 @@ AUTOCONF_OPTS += \

CFLAGS += -O2

#
# ntp unfortunately shares a symbol name with libc and generates a warning that
# would normally be fatal:
# ld: warning: symbol 'monitor' has differing types:
# (file ../libntp/libntp.a(audio.o) type=OBJT; file
# .../proto/usr/lib/libc.so type=FUNC);
# ../libntp/libntp.a(audio.o) definition taken
#
# Until such a time as this is fixed, we instead ignore -zfatal-warnings and
# just add -zassert-deflib. Unfortunately we don't have a programatic way to
# check it currently, but this will have to do for now.
#
LDFLAGS = $(T32_LDFLAGS) -zassert-deflib

AUTOCONF_ENV += \
LD_OPTIONS="$(LDFLAGS)" \
DESTDIR="$(DESTDIR)" \
Expand Down
8 changes: 5 additions & 3 deletions openssl/Makefile
Expand Up @@ -37,11 +37,13 @@ all: all32 all64
all32: $(VER)/$(CONFIG_STATUS)
cd $(VER); env - PATH=$(PATH) \
"CFLAGS=$(CFLAGS)" \
"LDFLAGS=$(LDFLAGS)" \
gmake

all64: $(VER64)/$(CONFIG_STATUS)
cd $(VER64); env - PATH=$(PATH) \
"CFLAGS=$(CFLAGS)" \
"LDFLAGS=$(LDFLAGS)" \
gmake

# opensslconf.h is patched to ensure suitability for both 64bit and 32bit
Expand All @@ -67,13 +69,13 @@ install64: all64
MACH64=amd64 VERDIR=$(VER64) BASE=$(BASE) DESTDIR=$(DESTDIR) \
VERSION=$(VERSION) ksh93 ./install-sfw-64

$(VER)/configure: $(VER)-src
cp -r $(VER)-src $(VER)
$(VER)/configure: $(BVER)-src
cp -r $(BVER)-src $(VER)
( cd $(VER) ; gpatch -p1 < ../configure.patch )
( cd $(VER) ; gpatch -p1 < ../aesni.patch )
cp engine_pkcs11/* $(VER)/crypto/engine/
touch $(VER)/configure
cp -r $(VER) $(VER64)

clean:
-rm -rf $(VER) $(VER64)
-rm -rf $(VER) $(VER64) $(VER)strap $(VER64)strap
7 changes: 6 additions & 1 deletion openssl/Makefile.com
Expand Up @@ -28,7 +28,8 @@


METAINFO_FILE = ../METADATA
VER = openssl-0.9.8x
BVER = openssl-0.9.8x
VER = $(BVER)$(STRAP)
VER64 =$(VER)-64

TARBALL = $(VER).tar.gz
Expand All @@ -39,6 +40,10 @@ PKCS11_LIB64 = /usr/lib/64/libpkcs11.so.1
CFLAGS = -DSOLARIS_OPENSSL -DNO_WINDOWS_BRAINDEATH
CFLAGS64 = $(CFLAGS)

ifneq ($(STRAP),strap)
LDFLAGS += $(GENLDFLAGS)
endif

GENERIC_CONFIGURE_OPTIONS = \
$(CFLAGS) \
--openssldir=/etc/openssl \
Expand Down

0 comments on commit 6938e49

Please sign in to comment.