Commit 1a5f18df authored by Christian Kastner's avatar Christian Kastner

d/patches: Update patch Properly-build-shared-and-static-libraries-programs

Filter out -pie, -fpie, and -fPIE when building the shared library.
parent 199b9df0
From: Christian Kastner <debian@kvr.at>
From: Christian Kastner <ckk@debian.org>
Date: Mon, 11 Apr 2011 19:26:09 +0200
Subject: Properly build shared and static libraries, programs
......@@ -8,16 +8,16 @@ extensions for all supported Python versions. Furthermore, add an install
target.
Forwarded: not-needed
Last-Update: 2014-07-26
Last-Update: 2016-04-24
---
Makefile | 128 +++++++++++++++++++++++++++++++++++++--------------------------
1 file changed, 75 insertions(+), 53 deletions(-)
Makefile | 129 +++++++++++++++++++++++++++++++++++++--------------------------
1 file changed, 76 insertions(+), 53 deletions(-)
diff --git a/Makefile b/Makefile
index 69b725b..df1b22d 100644
index 69b725b..d089359 100644
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,38 @@
@@ -1,16 +1,39 @@
-#
-# Choose your compiler
-#
......@@ -32,8 +32,9 @@ index 69b725b..df1b22d 100644
+LDFLAGS +=
+LIBS +=
+
+LIB_CFLAGS = $(CFLAGS) -fPIC
+LIB_LDFLAGS = $(LDFLAGS)
+# Libraries must not be compiled/linked with -pie, -fpie or -FPIE
+LIB_CFLAGS = $(filter-out -fPIE,$(CFLAGS)) -fPIC
+LIB_LDFLAGS = $(filter-out -fPIE, $(filter-out -pie,$(LDFLAGS)))
+LIB_LIBS = $(LIBS)
-#CC = gcc-4.2
......@@ -53,7 +54,7 @@ index 69b725b..df1b22d 100644
+LVER ?= 0
+LSUBVER ?= 0
+LIBFILE = libmpikmeans.so.$(LVER).$(LSUBVER)
+
+
+bindir ?= /usr/bin/
+libdir ?= /usr/lib/
+bindest = $(DESTDIR)$(bindir)
......@@ -68,7 +69,7 @@ index 69b725b..df1b22d 100644
#
# MPI KMEANS FLAGS
@@ -25,19 +47,6 @@ MATLABDIR=/agbs/share/sw/matlab
@@ -25,19 +48,6 @@ MATLABDIR=/agbs/share/sw/matlab
MATLAB_INCLUDE=-I$(MATLABDIR)/extern/include
#
......@@ -88,7 +89,7 @@ index 69b725b..df1b22d 100644
# ARCHITECURE
#
@@ -49,34 +58,31 @@ MATLAB_LIB=-L$(MATLABDIR)/bin/glnx86 -lmex
@@ -49,34 +59,31 @@ MATLAB_LIB=-L$(MATLABDIR)/bin/glnx86 -lmex
#SUFFIX=mexa64
#MATLAB_LIB=-L$(MATLABDIR)/bin/glnxa64 -lmex
......@@ -142,7 +143,7 @@ index 69b725b..df1b22d 100644
%_mex.o: %_mex.cxx
$(CC) $(CFLAGS) $(MATLAB_INCLUDE) $(VERBOSEFLAG) $(PRECISION) -c $^ -o $@
@@ -87,18 +93,34 @@ mpi_kmeans_mex.$(SUFFIX): libmpikmeans mpi_kmeans_mex.o
@@ -87,18 +94,34 @@ mpi_kmeans_mex.$(SUFFIX): libmpikmeans mpi_kmeans_mex.o
mpi_assign_mex.$(SUFFIX): libmpikmeans mpi_assign_mex.o
$(CC) mpi_assign_mex.o -shared -o mpi_assign_mex.$(SUFFIX) libmpikmeans.a $(MATLAB_LIB)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment