Skip to content

Commit

Permalink
OS-2559 illumos-extra should provide native node in proto.strap
Browse files Browse the repository at this point in the history
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Keith Wesolowski <keith.wesolowski@joyent.com>
  • Loading branch information
jclulow committed Oct 22, 2013
1 parent 16e0376 commit c0d6d32
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -74,6 +74,7 @@ STRAP_SUBDIRS = \
libxml \
libz \
make \
node.js \
nss-nspr \
openssl1x \
perl
Expand Down Expand Up @@ -128,7 +129,7 @@ $(DESTDIR)/usr/bin/gcc: $(DESTDIR)/usr/gnu/bin/gas
(cd gcc4 && \
PKG_CONFIG_LIBDIR="" \
STRAP=$(STRAP) \
$(MAKE) DESTDIR=$(DESTDIR) install)
$(MAKE) DESTDIR=$(DESTDIR) install strapfix)

$(SUBDIRS): $(DESTDIR)/usr/bin/gcc
(cd $@ && \
Expand Down
35 changes: 35 additions & 0 deletions gcc4/Makefile
Expand Up @@ -53,6 +53,24 @@ OVERRIDES += \
STAGE1_CFLAGS="$(CFLAGS)" \
CFLAGS_FOR_TARGET="$(CFLAGS)"

#
# The runtime libraries that we build into proto.strap should be made to search
# for their dependencies there as well, so that programs built to run on the
# build machine (from proto.strap) find the correct copies of these libraries.
#
ifeq ($(STRAP),strap)
STRAPFIX_LINKS= \
$(DESTDIR)/lib/64 \
$(DESTDIR)/usr/lib/64
STRAPFIX_FILES_32 = \
$(DESTDIR)/usr/lib/libgcc_s.so.1 \
$(DESTDIR)/usr/lib/libstdc++.so.6
STRAPFIX_FILES_64 = \
$(DESTDIR)/usr/lib/64/libgcc_s.so.1 \
$(DESTDIR)/usr/lib/64/libstdc++.so.6
STRAPFIX_FILES = $(STRAPFIX_FILES_32) $(STRAPFIX_FILES_64)
endif

#
# Unlike everything else, gcc is built to be a cross-compiler, really. It
# never runs on the target system, only the build system. So it should not
Expand Down Expand Up @@ -108,3 +126,20 @@ $(VER.32)/gmp: $(GMP_VER).tar.bz2 | $(VER.32)
-rmdir .unpack32
chmod 755 $@/configure
touch $@/configure

.PHONY: strapfix
strapfix: $(STRAPFIX_LINKS) $(STRAPFIX_FILES) | install
for f in $(STRAPFIX_FILES_32); do \
/usr/bin/elfedit -e \
'dyn:runpath $(DESTDIR)/lib:$(DESTDIR)/usr/lib' \
$$f; \
done
for f in $(STRAPFIX_FILES_64); do \
/usr/bin/elfedit -e \
'dyn:runpath $(DESTDIR)/lib/64:$(DESTDIR)/usr/lib/64' \
$$f; \
done

$(STRAPFIX_LINKS):
mkdir -p `dirname $@`
ln -s amd64 $@
5 changes: 5 additions & 0 deletions libz/Makefile
Expand Up @@ -63,6 +63,11 @@ LDSHARED_FLAGS.32 = $(LDSHARED_FLAGS) $(SYSLIBDIRS:%=-L$(DESTDIR)/%)
LDSHARED_FLAGS.64 = $(LDSHARED_FLAGS) $(SYSLIBDIRS:%=-L$(DESTDIR)/%/64)
LDSHARED_LIBS = -lc

ifeq ($(STRAP),strap)
LDSHARED_FLAGS.32 += $(SYSLIBDIRS:%=-R$(DESTDIR)/%)
LDSHARED_FLAGS.64 += $(SYSLIBDIRS:%=-R$(DESTDIR)/%/64)
endif

LDFLAGS += -L. -lz -lc
LDFLAGS.64 += -L. -lz -lc

Expand Down
6 changes: 5 additions & 1 deletion node.js/Makefile
Expand Up @@ -22,7 +22,7 @@
#

MAJOR_VER = 0.8
VER = node-v0.8.20
VER = node-v0.8.20

include ../Makefile.defs

Expand All @@ -46,6 +46,10 @@ CFLAGS += -Wno-unknown-pragmas
#
LDFLAGS += -lumem

ifeq ($(STRAP),strap)
LDFLAGS += $(SYSLIBDIRS:%=-R$(DESTDIR)/%)
endif

AUTOCONF_OPTS += \
--with-dtrace \
--openssl-use-sys \
Expand Down
5 changes: 5 additions & 0 deletions openssl1x/Makefile
Expand Up @@ -83,6 +83,11 @@ CFLAGS.64 += \

LIBS += -lsocket -lnsl

ifeq ($(STRAP),strap)
LDFLAGS += $(SYSLIBDIRS:%=-R$(DESTDIR)/%)
LDFLAGS.64 += $(SYSLIBDIRS:%=-R$(DESTDIR)/%/64)
endif

PATCHES = Patches/*

AUTOCONF_ENV =
Expand Down

0 comments on commit c0d6d32

Please sign in to comment.