Skip to content
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

libgccjit is not bundled into Emacs.app properly #7

Closed
jimeh opened this issue Aug 27, 2020 · 2 comments
Closed

libgccjit is not bundled into Emacs.app properly #7

jimeh opened this issue Aug 27, 2020 · 2 comments

Comments

@jimeh
Copy link
Owner

jimeh commented Aug 27, 2020

TL;DR: native-comp builds are not fully self-contained at the moment.

It seems that the library embedding mechanism that's in place is not enough to
get libgccjit working for native comp purposes, as it still seems to depend on
the patched gcc Homebrew formula being on disk under
/usr/local/Cellar/gcc/<version>/.

This is easy to test by temporarily renaming the
/usr/local/Cellar/gcc/<version> directory to something else.

I don't know enough about how libgccjit works to even have a rough plan for how
to fix this right now. Any updates or further info I find will be posted here.

@jimeh
Copy link
Owner Author

jimeh commented Aug 31, 2020

Discussions on #5 have led to a what looks like a solution for this issue. I'll do some more testing tomorrow evening to verify, and update the build script accordingly.

jimeh added a commit that referenced this issue Sep 3, 2020
The solution to get libgccjit properly working, and embedded in
Emacs.app included:

- The contents of GCC's lib folder (`/usr/local/opt/gcc/lib`) is copied
  into the `Contents/MacOS/lib-<arch>-<os_version>` folder.
- Setting `LIBRARY_PATH` environment variable to correct GCC lib
  folders within Emacs.app. This is done through a bash launcher script
  which replaces the regular `Contents/MacOS/Emacs` executable. The main
  Emacs executable itself is named `Emacs-bin` now instead, so anything
  that depends on the exact process name will need updating.
- The launcher script also adds `Content/MacOS/bin` and
  `Content/MacOS/libexec` folders to the PATH environment variable, to
  so ensure binary tools packaged into Emacs itself are available. This
  is done even when not doing a native-comp build. The launcher script
  skips setting LIBRARY_PATH if it's not a native-comp build.

This should hopefully resolve both #5 and #7.
jimeh added a commit that referenced this issue Sep 5, 2020
The solution to get libgccjit properly working, and embedded in
Emacs.app included:

- The contents of GCC's lib folder (`/usr/local/opt/gcc/lib`) is copied
  into the `Contents/MacOS/lib-<arch>-<os_version>` folder.
- Setting `LIBRARY_PATH` environment variable to correct GCC lib
  folders within Emacs.app. This is done through a bash launcher script
  which replaces the regular `Contents/MacOS/Emacs` executable. The main
  Emacs executable itself is named `Emacs-bin` now instead, so anything
  that depends on the exact process name will need updating.
- The launcher script also adds `Content/MacOS/bin` and
  `Content/MacOS/libexec` folders to the PATH environment variable, to
  so ensure binary tools packaged into Emacs itself are available. This
  is done even when not doing a native-comp build. The launcher script
  skips setting LIBRARY_PATH if it's not a native-comp build.

This should hopefully resolve both #5 and #7.
@jimeh
Copy link
Owner Author

jimeh commented Sep 5, 2020

This should now be fixed thanks to #10.

@jimeh jimeh closed this as completed Sep 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant