Skip to content

Commit

Permalink
Allows builds of 32-bit Self on 64-bit Linux systems
Browse files Browse the repository at this point in the history
  • Loading branch information
doublec committed Feb 17, 2011
1 parent d56a0b7 commit b4fbd2a
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -39,6 +39,7 @@ vm/linux/generated/Objs.zone
vm/linux/generated/Platform_linux
vm/linux/generated/Tags
vm/linux/generated/glueCheckSum
vm/linux/generated/glueFileList
vm/linux/generated/incls/_precompiled.hh
vm/linux/generated/includeDB
vm/linux/optimized/Self
Expand Down
2 changes: 1 addition & 1 deletion bin/shell/makeFileLists
Expand Up @@ -62,7 +62,7 @@ echo '${AOUT} files: ${PATCHED_OBJS}' >> $dep
echo '${AOUT}:' `cat $allobjs` '${GLUE_LIBS}' >> $dep
echo -n ' @lock_run _$@.lock' "'" >> $dep
echo ' echo Compiling vmDate ; \' >> $dep
echo ' make_vmDate; ${AS} vmDate.s -o vmDate.o; \'>> $dep
echo ' make_vmDate; ${AS} ${ASFLAGS} vmDate.s -o vmDate.o; \'>> $dep
echo ' check_locks ; \' >> $dep
echo ' echo Linking $@ ; \' >> $dep
echo ' rm -rf $@ cleanLocks; \' >> $dep # if disk space is tight...
Expand Down
4 changes: 2 additions & 2 deletions bin/src/makeDeps.cpp
Expand Up @@ -862,8 +862,8 @@ Bool list::compareLists(register list* s, database* cur, database* prev) {
void list::add(list* s) {
register item* i = new item(s);
// next two statements are for debugging
if ( i->next ) { printf("next %x\n", (unsigned)i->next); Plat.abort();}
if ( !i->contents ) { printf("c = %x\n", (unsigned)i->contents); Plat.abort();}
if ( i->next ) { printf("next %p\n", i->next); Plat.abort();}
if ( !i->contents ) { printf("c = %p\n", i->contents); Plat.abort();}

if (last) last->next = i;
else first = i;
Expand Down
Empty file removed vm/linux/generated/glueFileList
Empty file.
1 change: 1 addition & 0 deletions vm/templates/compile.make
Expand Up @@ -124,6 +124,7 @@ glue.o: glue.cpp
@lock_run _$@.lock " \
echo Linking $@; \
ld ${GLUE_LD_FLAGS} -o $@ $< ${EXTRA_LIBS} ${$*_libs}; \
ld ${GLUE_LD_FLAGS} -o $@ $< ${EXTRA_LIBS} ${$*_libs}; \
"

# Creating patched sigaction
Expand Down
12 changes: 6 additions & 6 deletions vm/templates/link.make
Expand Up @@ -79,12 +79,12 @@ else
LINK.gnu = CC -norunpath
endif

COMPILE.gnu.o = ${COMPILE.gnu} ${CFLAGS} -c
COMPILE.gnu.o.nog = ${COMPILE.gnu} ${CFLAGSnog} -c
COMPILE.gnu.s = ${COMPILE.gnu} ${CFLAGS} -S
COMPILE.gnu.i = ${COMPILE.gnu} ${CFLAGS} -E
COMPILE.gnu.o = ${COMPILE.gnu} ${GNUFLAGS} ${CFLAGS} -c
COMPILE.gnu.o.nog = ${COMPILE.gnu} ${GNUFLAGS} ${CFLAGSnog} -c
COMPILE.gnu.s = ${COMPILE.gnu} ${GNUFLAGS} ${CFLAGS} -S
COMPILE.gnu.i = ${COMPILE.gnu} ${GNUFLAGS} ${CFLAGS} -E

ASFLAGS =
ASFLAGS = --32
ifeq (${COMPILER}, GCC_COMPILER)
COMPILE1.s = ${COMPILE.gnu.i} -xc++
else
Expand Down Expand Up @@ -133,7 +133,7 @@ ifeq (${COMPILER}, GCC_COMPILER)
# LD = PURIFYOPTIONS="-HOME=$(PURELINKHOME)" \
# ${GCC} ${CC_PURELINK_OPTS} ${LDFLAGS}
else
LDFLAGS += ${LIBDIRS} -e start -dc -dp
LDFLAGS += ${LIBDIRS} -e start -dc -dp -m32
# Get gcc to call ld directly
# for Jaguar:
LD = ${GCC} -B/usr/bin/ ${LDFLAGS}
Expand Down
8 changes: 4 additions & 4 deletions vm/templates/linux.make
Expand Up @@ -20,18 +20,18 @@ SRC_PATH = ${ROOT}/vm/${VM_SUBDIR}/generated/incls \
$(SRC_DIRS:%=${ROOT}/vm/src/%)

#ASM_FILTER = | removeUnderscore | sed 's;//.*;;'
GLUE_LD_FLAGS = -G
GLUE_LD_FLAGS = -G -m32
VPATH += $(SRC_PATH:%=%:)
CPP = /usr/bin/cpp

XLIBLIBDIRS = -L/usr/lib
XLIBLIBDIRS =
CLIBS = -lstdc++ -lnsl -lc
# no -lsocket


# link termcap and ucb statically to avoid having to mess with LD_LIBRARY_PATH
#OS_GLUE_LIBS = /usr/ucblib/libtermcap.a /usr/ucblib/libucb.a -lm
OS_GLUE_LIBS = /usr/lib/libncurses.a -lm -lpthread
OS_GLUE_LIBS = -lncurses -lm -lpthread

# precomp headers for Linux
# _precompiled.hh is in generated/incls, _precomiped.gch is in debug, optimized, etc.
Expand All @@ -56,7 +56,7 @@ CONFIGDEFS = \
-DMANUFACTURER=${MANUFACTURER}

INCLUDE_PRECOMP = -include _precompiled.hh
GNUFLAGS += -fno-exceptions -ffriend-injection -Winvalid-pch -fno-stack-protector
GNUFLAGS += -m32 -fno-exceptions -ffriend-injection -Winvalid-pch -fno-stack-protector

INCLUDES += -I/usr/include -I/usr/include/X11 -I/usr/lib/c++/4.1

Expand Down

0 comments on commit b4fbd2a

Please sign in to comment.