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

Build.xml: Add /opt/homebrew/lib as rpath on arm64 macos #1783

Merged
merged 1 commit into from
May 15, 2024

Conversation

tobil4sk
Copy link
Contributor

This is where arm64 homebrew installs libneko.dylib. However, it may still be in /usr/local/lib if installed via the haxe .pkg installer, so we add both. See the discussion in: c70ec9f.

Closes #1750.

We should use install_name_tool -delete-rpath [path] to remove rpaths when copying lime.ndll into a cpp build, because we only need the rpath for neko builds (where libneko.dylib is going to be loaded), and having an unnecessary rpath is a security concern. I'm not too sure where to do this, I guess maybe here after copying it? @joshtynjala

ProjectHelper.copyLibrary(project, ndll, "Mac" + dirSuffix, "",
(ndll.haxelib != null
&& (ndll.haxelib.name == "hxcpp" || ndll.haxelib.name == "hxlibc")) ? ".dll" : ".ndll", executableDirectory,
project.debug, targetSuffix);
.

This is where arm64 homebrew installs `libneko.dylib`. However, it may still be in `/usr/local/lib` if installed via the haxe .pkg installer, so we add both.
tobil4sk referenced this pull request May 10, 2024
This seems to be required with Xcode 15, but was not required previously
@joshtynjala
Copy link
Member

I'm not too sure where to do this, I guess maybe here after copying it?

Yeah, in the if (targetType == "neko") section below seems good to me:

if (targetType == "neko")
{
System.runCommand("", "haxe", [hxml]);
if (noOutput) return;
NekoHelper.createExecutable(project.templatePaths, "mac" + dirSuffix.toLowerCase(), targetDirectory + "/obj/ApplicationMain.n", executablePath);
NekoHelper.copyLibraries(project.templatePaths, "mac" + dirSuffix.toLowerCase(), executableDirectory);
}

I put similar install_name_tool commands for HashLink in the else if (targetType == "hl") section after that in the 8.2.0-Dev branch.

@joshtynjala joshtynjala merged commit 333d093 into openfl:develop May 15, 2024
23 checks passed
@tobil4sk tobil4sk deleted the fix/mac-rpath branch May 15, 2024 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lime.ndll fails to load libneko.dylib with certain homebrew installs of haxe/neko
2 participants