-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
WIP: improve support for crosscompiling to musl32 #62817
Closed
Closed
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
db5d5e2
disable stackprotector on target platform musl32
wfranzini ee2ad96
libexecinfo: enables stackprotector through hardeningEnable
wfranzini 533dcc7
libsodium: disable stackprotector on musl32
wfranzini 3a163f9
audit: backport from upstream support for system w/o strndupa/rawmemchr
wfranzini 63762fc
bison2: add perl in nativeBuildInputs
wfranzini b509a5f
sox: musl does not support pipe rewind
wfranzini c6ecd1a
identify musl32 using x86_32 instead of i686
wfranzini 8b7219b
add stackprotector support on musl32
wfranzini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
pkgs/development/libraries/libexecinfo/30-linux-makefile.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <[email protected]>, 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if alpine has a way to get ssp working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.
https://git.alpinelinux.org/aports/tree/main/musl?h=master
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.