Attached Files |
-
mercury-linker-flags.patch (5,206 bytes) 2013-06-04 03:27
diff --git a/boehm_gc/Makefile.direct b/boehm_gc/Makefile.direct
index 373bf84..ca1074c 100644
--- a/boehm_gc/Makefile.direct
+++ b/boehm_gc/Makefile.direct
@@ -359,17 +359,18 @@ lib$(GC_GRADE).so: $(OBJS) $(UTILS) # dyn_load_sunos53.o
./if_mach SPARC SOLARIS $(MAKE) dyn_load_sunos53.o
./if_mach SPARC SOLARIS \
$(LINK_SHARED_OBJ) -o lib$(GC_GRADE).so $(OBJS) dyn_load_sunos53.o \
- -ldl $(MAYBE_THREAD_LIBS)
+ -ldl $(MAYBE_THREAD_LIBS) $(EXTRA_LDFLAGS)
./if_not_there on_sparc_sunos5_so $(MAKE) dyn_load.o
./if_not_there on_sparc_sunos5_so \
$(LINK_SHARED_OBJ) -o lib$(GC_GRADE).so $(OBJS) dyn_load.o \
- -lc $(MAYBE_THREAD_LIBS)
+ -lc $(MAYBE_THREAD_LIBS) $(EXTRA_LDFLAGS)
# Darwin shared library version of the gc.
lib$(GC_GRADE).dylib: $(OBJS) $(UTILS)
$(LINK_SHARED_OBJ) -install_name \
$(FINAL_INSTALL_MERC_GC_LIB_DIR)/lib$(GC_GRADE).dylib \
- -o lib$(GC_GRADE).dylib $(OBJS) dyn_load.o -lc
+ -o lib$(GC_GRADE).dylib $(OBJS) dyn_load.o \
+ -lc $(EXTRA_LDFLAGS)
# SunOS5 shared library version of the collector
sunos5gc.so: $(OBJS) dyn_load_sunos53.o
diff --git a/runtime/Mmakefile b/runtime/Mmakefile
index f6908cf..4957d16 100644
--- a/runtime/Mmakefile
+++ b/runtime/Mmakefile
@@ -392,7 +392,7 @@ lib$(RT_LIB_NAME).so: $(PIC_OBJS)
$(LINK_SHARED_OBJ) $(ERROR_UNDEFINED) \
-o lib$(RT_LIB_NAME).so $(PIC_OBJS) \
$(SHLIB_RPATH_OPT)$(FINAL_INSTALL_MERC_GC_LIB_DIR) \
- $(LDFLAGS) $(LDLIBS) $(THREADLIBS) \
+ $(ALL_LDFLAGS) $(LDLIBS) $(THREADLIBS) \
$(SHARED_LIBS)
# For Darwin we should pass the -install_name option.
@@ -401,7 +401,7 @@ lib$(RT_LIB_NAME).dylib: $(PIC_OBJS)
-o lib$(RT_LIB_NAME).dylib $(PIC_OBJS) \
-install_name \
$(FINAL_INSTALL_MERC_LIB_DIR)/lib$(RT_LIB_NAME).dylib \
- $(LDFLAGS) $(LDLIBS) $(THREADLIBS) \
+ $(ALL_LDFLAGS) $(LDLIBS) $(THREADLIBS) \
$(SHARED_LIBS)
endif
diff --git a/trace/Mmakefile b/trace/Mmakefile
index 3138bba..47e8fa9 100644
--- a/trace/Mmakefile
+++ b/trace/Mmakefile
@@ -273,14 +273,16 @@ lib$(TRACE_LIB_NAME).so: $(TRACE_PIC_OBJS) lib$(EVENTSPEC_LIB_NAME).so
$(LINK_SHARED_OBJ) $(ERROR_UNDEFINED) \
-o lib$(TRACE_LIB_NAME).so $(TRACE_PIC_OBJS) \
$(RPATH_1)$(RPATH_2) \
- $(TRACE_LDFLAGS) $(TRACE_LDLIBS) $(THREADLIBS) \
+ $(ALL_LDFLAGS) $(TRACE_LDFLAGS) \
+ $(TRACE_LDLIBS) $(THREADLIBS) \
$(SHARED_LIBS)
lib$(EVENTSPEC_LIB_NAME).so: $(EVENTSPEC_PIC_OBJS)
$(LINK_SHARED_OBJ) $(ERROR_UNDEFINED) \
-o lib$(EVENTSPEC_LIB_NAME).so $(EVENTSPEC_PIC_OBJS) \
$(RPATH_1)$(RPATH_2) \
- $(EVENTSPEC_LDFLAGS) $(EVENTSPEC_LDLIBS) $(THREADLIBS) \
+ $(ALL_LDFLAGS) $(EVENTSPEC_LDFLAGS) \
+ $(EVENTSPEC_LDLIBS) $(THREADLIBS) \
$(SHARED_LIBS)
# For Darwin:
@@ -289,7 +291,8 @@ lib$(TRACE_LIB_NAME).dylib: $(TRACE_PIC_OBJS) lib$(EVENTSPEC_LIB_NAME).dylib
-o lib$(TRACE_LIB_NAME).dylib $(TRACE_PIC_OBJS) \
-install_name \
$(FINAL_INSTALL_MERC_LIB_DIR)/lib$(TRACE_LIB_NAME).dylib \
- $(TRACE_LDFLAGS) $(TRACE_LDLIBS) $(THREADLIBS) \
+ $(ALL_LDFLAGS) $(TRACE_LDFLAGS) \
+ $(TRACE_LDLIBS) $(THREADLIBS) \
$(SHARED_LIBS)
lib$(EVENTSPEC_LIB_NAME).dylib: $(EVENTSPEC_PIC_OBJS)
@@ -297,7 +300,8 @@ lib$(EVENTSPEC_LIB_NAME).dylib: $(EVENTSPEC_PIC_OBJS)
-o lib$(EVENTSPEC_LIB_NAME).dylib $(EVENTSPEC_PIC_OBJS) \
-install_name \
$(FINAL_INSTALL_MERC_LIB_DIR)/lib$(EVENTSPEC_LIB_NAME).dylib \
- $(EVENTSPEC_LDFLAGS) $(EVENTSPEC_LDLIBS) $(THREADLIBS) \
+ $(ALL_LDFLAGS) $(EVENTSPEC_LDFLAGS) \
+ $(EVENTSPEC_LDLIBS) $(THREADLIBS) \
$(SHARED_LIBS)
.PHONY: cs
diff --git a/util/Mmakefile b/util/Mmakefile
index c3ff7aa..80ba6d2 100644
--- a/util/Mmakefile
+++ b/util/Mmakefile
@@ -51,30 +51,30 @@ all: $(PROGFILENAMES) $(TAGS_FILE_EXISTS)
ifeq ($(USING_MICROSOFT_CL_COMPILER),yes)
.c$(EXT_FOR_EXE):
$(MGNUC) --no-mercury-stdlib-dir \
- $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -Fe$@ $< $(GETOPT_SRC)
+ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -Fe$@ $< $(GETOPT_SRC)
mkinit$(EXT_FOR_EXE): mkinit.c mkinit_common.c mkinit_common.h
$(MGNUC) --no-mercury-stdlib-dir \
- $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -Fe$@ \
+ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -Fe$@ \
mkinit.c mkinit_common.c $(GETOPT_SRC)
mkinit_erl$(EXT_FOR_EXE): mkinit_erl.c mkinit_common.c mkinit_common.h
$(MGNUC) --no-mercury-stdlib-dir \
- $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -Fe$@ \
+ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -Fe$@ \
mkinit_erl.c mkinit_common.c $(GETOPT_SRC)
else
.c$(EXT_FOR_EXE):
$(MGNUC) --no-mercury-stdlib-dir \
- $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -o $@ $< $(GETOPT_SRC)
+ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -o $@ $< $(GETOPT_SRC)
mkinit$(EXT_FOR_EXE): mkinit.c mkinit_common.c mkinit_common.h
$(MGNUC) --no-mercury-stdlib-dir \
- $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -o $@ \
+ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -o $@ \
mkinit.c mkinit_common.c $(GETOPT_SRC)
mkinit_erl$(EXT_FOR_EXE): mkinit_erl.c mkinit_common.c mkinit_common.h
$(MGNUC) --no-mercury-stdlib-dir \
- $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -o $@ \
+ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -o $@ \
mkinit_erl.c mkinit_common.c $(GETOPT_SRC)
endif
-
mercury-linker-flags-v2.patch (5,242 bytes) 2013-06-07 00:19
diff --git a/boehm_gc/Makefile.direct b/boehm_gc/Makefile.direct
index 373bf84..97a43a7 100644
--- a/boehm_gc/Makefile.direct
+++ b/boehm_gc/Makefile.direct
@@ -359,11 +359,11 @@ lib$(GC_GRADE).so: $(OBJS) $(UTILS) # dyn_load_sunos53.o
./if_mach SPARC SOLARIS $(MAKE) dyn_load_sunos53.o
./if_mach SPARC SOLARIS \
$(LINK_SHARED_OBJ) -o lib$(GC_GRADE).so $(OBJS) dyn_load_sunos53.o \
- -ldl $(MAYBE_THREAD_LIBS)
+ -ldl $(MAYBE_THREAD_LIBS) $(LD_LIBFLAGS) $(EXTRA_LD_LIBFLAGS)
./if_not_there on_sparc_sunos5_so $(MAKE) dyn_load.o
./if_not_there on_sparc_sunos5_so \
$(LINK_SHARED_OBJ) -o lib$(GC_GRADE).so $(OBJS) dyn_load.o \
- -lc $(MAYBE_THREAD_LIBS)
+ -lc $(MAYBE_THREAD_LIBS) $(LD_LIBFLAGS) $(EXTRA_LD_LIBFLAGS)
# Darwin shared library version of the gc.
lib$(GC_GRADE).dylib: $(OBJS) $(UTILS)
diff --git a/runtime/Mmakefile b/runtime/Mmakefile
index f6908cf..6d9c672 100644
--- a/runtime/Mmakefile
+++ b/runtime/Mmakefile
@@ -248,7 +248,7 @@ MGNUCFLAGS += --c-debug --no-ansi
OBJS = $(CFILES:.c=.$O)
PIC_OBJS = $(CFILES:.c=.$(EXT_FOR_PIC_OBJECTS))
-LDFLAGS = -L$(BOEHM_GC_DIR) -L/usr/local/lib
+LD_LIBFLAGS = -L$(BOEHM_GC_DIR) -L/usr/local/lib
LDLIBS = $(SHARED_GC_LIBS) $(MATH_LIB)
THREADLIBS = \
@@ -392,7 +392,7 @@ lib$(RT_LIB_NAME).so: $(PIC_OBJS)
$(LINK_SHARED_OBJ) $(ERROR_UNDEFINED) \
-o lib$(RT_LIB_NAME).so $(PIC_OBJS) \
$(SHLIB_RPATH_OPT)$(FINAL_INSTALL_MERC_GC_LIB_DIR) \
- $(LDFLAGS) $(LDLIBS) $(THREADLIBS) \
+ $(ALL_LD_LIBFLAGS) $(LDLIBS) $(THREADLIBS) \
$(SHARED_LIBS)
# For Darwin we should pass the -install_name option.
@@ -401,7 +401,7 @@ lib$(RT_LIB_NAME).dylib: $(PIC_OBJS)
-o lib$(RT_LIB_NAME).dylib $(PIC_OBJS) \
-install_name \
$(FINAL_INSTALL_MERC_LIB_DIR)/lib$(RT_LIB_NAME).dylib \
- $(LDFLAGS) $(LDLIBS) $(THREADLIBS) \
+ $(ALL_LD_LIBFLAGS) $(LDLIBS) $(THREADLIBS) \
$(SHARED_LIBS)
endif
diff --git a/trace/Mmakefile b/trace/Mmakefile
index 3138bba..79e00c4 100644
--- a/trace/Mmakefile
+++ b/trace/Mmakefile
@@ -273,14 +273,16 @@ lib$(TRACE_LIB_NAME).so: $(TRACE_PIC_OBJS) lib$(EVENTSPEC_LIB_NAME).so
$(LINK_SHARED_OBJ) $(ERROR_UNDEFINED) \
-o lib$(TRACE_LIB_NAME).so $(TRACE_PIC_OBJS) \
$(RPATH_1)$(RPATH_2) \
- $(TRACE_LDFLAGS) $(TRACE_LDLIBS) $(THREADLIBS) \
+ $(ALL_LD_LIBFLAGS) $(TRACE_LDFLAGS) \
+ $(TRACE_LDLIBS) $(THREADLIBS) \
$(SHARED_LIBS)
lib$(EVENTSPEC_LIB_NAME).so: $(EVENTSPEC_PIC_OBJS)
$(LINK_SHARED_OBJ) $(ERROR_UNDEFINED) \
-o lib$(EVENTSPEC_LIB_NAME).so $(EVENTSPEC_PIC_OBJS) \
$(RPATH_1)$(RPATH_2) \
- $(EVENTSPEC_LDFLAGS) $(EVENTSPEC_LDLIBS) $(THREADLIBS) \
+ $(ALL_LD_LIBFLAGS) $(EVENTSPEC_LDFLAGS) \
+ $(EVENTSPEC_LDLIBS) $(THREADLIBS) \
$(SHARED_LIBS)
# For Darwin:
@@ -289,7 +291,8 @@ lib$(TRACE_LIB_NAME).dylib: $(TRACE_PIC_OBJS) lib$(EVENTSPEC_LIB_NAME).dylib
-o lib$(TRACE_LIB_NAME).dylib $(TRACE_PIC_OBJS) \
-install_name \
$(FINAL_INSTALL_MERC_LIB_DIR)/lib$(TRACE_LIB_NAME).dylib \
- $(TRACE_LDFLAGS) $(TRACE_LDLIBS) $(THREADLIBS) \
+ $(ALL_LD_LIBFLAGS) $(TRACE_LDFLAGS) \
+ $(TRACE_LDLIBS) $(THREADLIBS) \
$(SHARED_LIBS)
lib$(EVENTSPEC_LIB_NAME).dylib: $(EVENTSPEC_PIC_OBJS)
@@ -297,7 +300,8 @@ lib$(EVENTSPEC_LIB_NAME).dylib: $(EVENTSPEC_PIC_OBJS)
-o lib$(EVENTSPEC_LIB_NAME).dylib $(EVENTSPEC_PIC_OBJS) \
-install_name \
$(FINAL_INSTALL_MERC_LIB_DIR)/lib$(EVENTSPEC_LIB_NAME).dylib \
- $(EVENTSPEC_LDFLAGS) $(EVENTSPEC_LDLIBS) $(THREADLIBS) \
+ $(ALL_LD_LIBFLAGS) $(EVENTSPEC_LDFLAGS) \
+ $(EVENTSPEC_LDLIBS) $(THREADLIBS) \
$(SHARED_LIBS)
.PHONY: cs
diff --git a/util/Mmakefile b/util/Mmakefile
index c3ff7aa..80ba6d2 100644
--- a/util/Mmakefile
+++ b/util/Mmakefile
@@ -51,30 +51,30 @@ all: $(PROGFILENAMES) $(TAGS_FILE_EXISTS)
ifeq ($(USING_MICROSOFT_CL_COMPILER),yes)
.c$(EXT_FOR_EXE):
$(MGNUC) --no-mercury-stdlib-dir \
- $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -Fe$@ $< $(GETOPT_SRC)
+ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -Fe$@ $< $(GETOPT_SRC)
mkinit$(EXT_FOR_EXE): mkinit.c mkinit_common.c mkinit_common.h
$(MGNUC) --no-mercury-stdlib-dir \
- $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -Fe$@ \
+ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -Fe$@ \
mkinit.c mkinit_common.c $(GETOPT_SRC)
mkinit_erl$(EXT_FOR_EXE): mkinit_erl.c mkinit_common.c mkinit_common.h
$(MGNUC) --no-mercury-stdlib-dir \
- $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -Fe$@ \
+ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -Fe$@ \
mkinit_erl.c mkinit_common.c $(GETOPT_SRC)
else
.c$(EXT_FOR_EXE):
$(MGNUC) --no-mercury-stdlib-dir \
- $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -o $@ $< $(GETOPT_SRC)
+ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -o $@ $< $(GETOPT_SRC)
mkinit$(EXT_FOR_EXE): mkinit.c mkinit_common.c mkinit_common.h
$(MGNUC) --no-mercury-stdlib-dir \
- $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -o $@ \
+ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -o $@ \
mkinit.c mkinit_common.c $(GETOPT_SRC)
mkinit_erl$(EXT_FOR_EXE): mkinit_erl.c mkinit_common.c mkinit_common.h
$(MGNUC) --no-mercury-stdlib-dir \
- $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -o $@ \
+ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -o $@ \
mkinit_erl.c mkinit_common.c $(GETOPT_SRC)
endif
|
---|