openfl / lime

A foundational Haxe framework for cross-platform development
https://lime.openfl.org/
MIT License
754 stars 370 forks source link

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

Closed tobil4sk closed 4 months ago

tobil4sk commented 4 months ago

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: https://github.com/openfl/lime/commit/c70ec9fbe02b8d98f6562ee7a403f812549ea387.

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 https://github.com/openfl/lime/blob/c70ec9fbe02b8d98f6562ee7a403f812549ea387/tools/platforms/MacPlatform.hx#L175-L178.

joshtynjala commented 4 months ago

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:

https://github.com/openfl/lime/blob/c70ec9fbe02b8d98f6562ee7a403f812549ea387/tools/platforms/MacPlatform.hx#L183-L191

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.