Skip to content

Commit

Permalink
objconv cannot do in-place modification of files
Browse files Browse the repository at this point in the history
  • Loading branch information
tkelman committed Oct 19, 2014
1 parent cf82345 commit b99f16f
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions deps/openblas-symbol-rename.patch
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ index d2ff741..ec6339d 100644

include $(TOPDIR)/Makefile.$(ARCH)
diff --git a/exports/Makefile b/exports/Makefile
index c798bc7..9ed5a0f 100644
index c798bc7..f68da88 100644
--- a/exports/Makefile
+++ b/exports/Makefile
@@ -88,12 +88,17 @@ dll : ../$(LIBDLLNAME)
@@ -88,12 +88,18 @@ dll : ../$(LIBDLLNAME)
-Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive $(FEXTRALIB) $(EXTRALIB)

libopenblas.def : gensymbol
Expand All @@ -44,26 +44,39 @@ index c798bc7..9ed5a0f 100644
+ifeq (, $(SYMBOLPREFIX)$(SYMBOLSUFFIX))
$(LIBDYNNAME) : ../$(LIBNAME) osx.def
+else
+$(LIBDYNNAME) : ../$(LIBNAME) osx.def objconv.def
+ $(OBJCONV) @objconv.def ../$(LIBNAME)
+../$(LIBNAME).renamed : ../$(LIBNAME) objconv.def
+ $(OBJCONV) @objconv.def ../$(LIBNAME) ../$(LIBNAME).renamed
+$(LIBDYNNAME) : ../$(LIBNAME).renamed osx.def
+endif
$(FC) $(FFLAGS) -all_load -headerpad_max_install_names -install_name $(CURDIR)/../$(LIBDYNNAME) -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB)

dllinit.$(SUFFIX) : dllinit.c
@@ -103,7 +108,12 @@ ifeq ($(OSNAME), Linux)
@@ -103,16 +109,22 @@ ifeq ($(OSNAME), Linux)

so : ../$(LIBSONAME)

+ifeq (, $(SYMBOLPREFIX)$(SYMBOLSUFFIX))
../$(LIBSONAME) : ../$(LIBNAME) linktest.c
+else
+../$(LIBSONAME) : ../$(LIBNAME) linktest.c objcopy.def
+ $(OBJCOPY) --redefine-syms objcopy.def ../$(LIBNAME)
+../$(LIBNAME).renamed : ../$(LIBNAME) objcopy.def
+ $(OBJCOPY) --redefine-syms objcopy.def ../$(LIBNAME) ../$(LIBNAME).renamed
+../$(LIBSONAME) : ../$(LIBNAME).renamed linktest.c
+endif
ifneq ($(C_COMPILER), LSB)
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
-Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive \
@@ -125,7 +135,12 @@ ifeq ($(OSNAME), $(filter $(OSNAME),FreeBSD NetBSD))
- -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive \
+ -Wl,--whole-archive $< -Wl,--no-whole-archive \
-Wl,-soname,$(LIBPREFIX).so.$(MAJOR_VERSION) $(EXTRALIB)
$(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
else
#for LSB
env LSBCC_SHAREDLIBS=gfortran $(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
- -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive \
+ -Wl,--whole-archive $< -Wl,--no-whole-archive \
-Wl,-soname,$(LIBPREFIX).so.$(MAJOR_VERSION) $(EXTRALIB)
$(FC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
endif
@@ -125,7 +137,12 @@ ifeq ($(OSNAME), $(filter $(OSNAME),FreeBSD NetBSD))

so : ../$(LIBSONAME)

Expand All @@ -76,7 +89,7 @@ index c798bc7..9ed5a0f 100644
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
-Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive \
$(FEXTRALIB) $(EXTRALIB)
@@ -178,17 +193,23 @@ static : ../$(LIBNAME)
@@ -178,17 +195,23 @@ static : ../$(LIBNAME)
rm -f goto.$(SUFFIX)

osx.def : gensymbol ../Makefile.system ../getarch.c
Expand Down

0 comments on commit b99f16f

Please sign in to comment.