-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
emacs: Make gccemacs build on darwin #94637
Changes from 7 commits
038e86f
0d15ea9
1759959
861f270
a891ae4
41e34e7
ad7a3fb
3384837
6ad323d
04fffd6
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 |
---|---|---|
|
@@ -251,7 +251,7 @@ postInstall() { | |
fi | ||
|
||
if type "install_name_tool"; then | ||
for i in "${!outputLib}"/lib/*.*.dylib; do | ||
for i in "${!outputLib}"/lib/*.*.dylib "${!outputLib}"/lib/*.so.[0-9]; do | ||
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. Is it a bug in gcc buildsystem that they install libgccjit as .so file? 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. Looks like this needs to be fixed here: https://github.com/gcc-mirror/gcc/blob/41d6b10e96a1de98e90a7c0378437c3255814b16/gcc/jit/Make-lang.in#L43 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. Yep, looks like it. They still make weird linux-soname based assumptions around how the structure works, but I think we could just set this as a make variable (or patch it) to fix. Probably the better way to fix it! 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. They have it conditionals for windows but not for macOS now: https://github.com/gcc-mirror/gcc/blob/229752afe3156a3990dacaedb94c76846cebf132/gcc/jit/Make-lang.in#L48 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. Anyway if you don't patch the build system would it not be better to rename it from .so to .dylib? |
||
install_name_tool -id "$i" "$i" || true | ||
for old_path in $(otool -L "$i" | grep "$out" | awk '{print $1}'); do | ||
new_path=`echo "$old_path" | sed "s,$out,${!outputLib},"` | ||
|
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.
Wondering if we should use -B here
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.
Do you mean for binutils's
ld
? Darwin'sld
does not support any-B
options, as far as I can tell.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 think
-B
is a CC flag, so it's gcc that handles it. I think gccemacs only cares about library files, so I'm not sure if the-L
vs.-B
is relevant though.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.
Ah, it may depend on whether libgccjit recognizes that option as a "driver" option (vs. a "frontend" option I guess?) - the manual warns that only options for the assembler or linker will be meaningful as "driver options". Definitely something to experiment with, though!
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.
Yes, the guix packaging for native-comp explicitly uses the -B option flatwhatson/guix-channel@f9bf0a4 else it complains about not finding crti.o, crtbeginS.o, and -lgcc. I haven't been able to compile this successfully else I'd test.
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.
Fascinating! I'll try that - might also help us get rid of the need to use wrapProgram to set paths to the linker and assembler.
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.
Ok, just confirmed that on linux building with the -B option is necessary for straight.el to compile packages outside of nix else it segfaults.