-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
WIP: improve support for crosscompiling to musl32 #62817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
db5d5e2
ee2ad96
533dcc7
3a163f9
63762fc
b509a5f
c6ecd1a
8b7219b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 <mcs@darkregion.net>, 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 <bsd.lib.mk> | ||
| +clean: | ||
| + rm -rf *.o *.So *.a *.so |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,14 +20,11 @@ stdenv.mkDerivation rec { | |
| url = https://git.alpinelinux.org/cgit/aports/plain/main/libexecinfo/20-define-gnu-source.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1; | ||
| sha256 = "1mp8mc639b0h2s69m5z6s2h3q3n1zl298j9j0plzj7f979j76302"; | ||
| }) | ||
| (fetchpatch { | ||
| name = "30-linux-makefile.patch"; | ||
| url = https://git.alpinelinux.org/cgit/aports/plain/main/libexecinfo/30-linux-makefile.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1; | ||
| sha256 = "1jwjz22z5cjy5h2bfghn62yl9ar8jiqhdvbwrcfavv17ihbhwcaf"; | ||
| }) | ||
| ./30-linux-makefile.patch | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if alpine has a way to get ssp working?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @matthewbauer Alpinelinux creates a small libssp_nonshared library in the musl-dev package. I've recreated it in my local nixpkgs repo, however I'm not sure how to automatically link with libssp_nonshared.a. Do you have a hint?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You probably need to put it in musl's $out/lib/libssp_nonshared.a. Unfortunately we also need to apply this patch to GCC: https://git.alpinelinux.org/aports/tree/main/gcc/gcc-6.1-musl-libssp.patch That would probably be okay to apply to GCC, but maybe only on i686-musl builds. |
||
| ]; | ||
|
|
||
| makeFlags = [ "CC:=$(CC)" "AR:=$(AR)" ]; | ||
| hardeningEnable = [ "stackprotector" ]; | ||
|
|
||
| patchFlags = "-p0"; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.