diff --git a/pkgs/development/libraries/libexecinfo/30-linux-makefile.patch b/pkgs/development/libraries/libexecinfo/30-linux-makefile.patch new file mode 100644 index 000000000000..134c64441d36 --- /dev/null +++ b/pkgs/development/libraries/libexecinfo/30-linux-makefile.patch @@ -0,0 +1,44 @@ +--- Makefile.orig ++++ Makefile +@@ -23,24 +23,25 @@ + # SUCH DAMAGE. + # + # $Id: Makefile,v 1.3 2004/07/19 05:19:55 sobomax Exp $ ++# ++# Linux Makefile by Matt Smith , 2011/01/04 + +-LIB= execinfo ++CC=cc ++AR=ar ++EXECINFO_CFLAGS=$(CFLAGS) -O2 -pipe -fno-strict-aliasing -std=gnu99 -c ++EXECINFO_LDFLAGS=$(LDFLAGS) + +-SRCS= stacktraverse.c stacktraverse.h execinfo.c execinfo.h ++all: static dynamic + +-INCS= execinfo.h ++static: ++ $(CC) $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) stacktraverse.c ++ $(CC) $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) execinfo.c ++ $(AR) rcs libexecinfo.a stacktraverse.o execinfo.o + +-SHLIB_MAJOR= 1 +-SHLIB_MINOR= 0 ++dynamic: ++ $(CC) -fpic -DPIC $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) stacktraverse.c -o stacktraverse.So ++ $(CC) -fpic -DPIC $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) execinfo.c -o execinfo.So ++ $(CC) -shared -Wl,-soname,libexecinfo.so.1 -o libexecinfo.so.1 stacktraverse.So execinfo.So + +-NOPROFILE= yes +- +-DPADD= ${LIBM} +-LDADD= -lm +- +-#WARNS?= 4 +- +-#stacktraverse.c: gen.py +-# ./gen.py > stacktraverse.c +- +-.include ++clean: ++ rm -rf *.o *.So *.a *.so diff --git a/pkgs/development/libraries/libexecinfo/default.nix b/pkgs/development/libraries/libexecinfo/default.nix index f3f89209707a..36f956e77724 100644 --- a/pkgs/development/libraries/libexecinfo/default.nix +++ b/pkgs/development/libraries/libexecinfo/default.nix @@ -23,14 +23,11 @@ stdenv.mkDerivation rec { url = "https://git.alpinelinux.org/aports/plain/main/libexecinfo/20-define-gnu-source.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1"; sha256 = "1mp8mc639b0h2s69m5z6s2h3q3n1zl298j9j0plzj7f979j76302"; }) - (fetchpatch { - name = "30-linux-makefile.patch"; - url = "https://git.alpinelinux.org/aports/plain/main/libexecinfo/30-linux-makefile.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1"; - sha256 = "1jwjz22z5cjy5h2bfghn62yl9ar8jiqhdvbwrcfavv17ihbhwcaf"; - }) + ./30-linux-makefile.patch ]; makeFlags = [ "CC:=$(CC)" "AR:=$(AR)" ]; + hardeningEnable = [ "stackprotector" ]; buildFlags = lib.optional enableStatic "static"