-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use linker tools on OSX & Linux to limit exports (#4651) #5659
Conversation
Feel free to push your corrections directly to this PR |
That's the plan 🙂 |
The linker scripts are much less arcane than I feared |
Okay, I have tested my CMake changes on Linux with GCC and the following linkers: GNU LD, GOLD (via |
Looks good! Just needs reviewer approval. |
The caveat with this approach alone as opposed to #5655 is that while it resolves the issue for the final library, |
@LebedevRI - IIRC the issue was that we consume standard library types through our API which makes the situation on Windows a lot harder. For instance, I don't think you can export a class that takes in a |
I don't know the windows situation, but i would like to note that even with the current linker script approach, |
As a way to address #4651, but as a hopefully-simpler alternative to #5655, this adds linker-specific scripts for Linux and OSX builds that exports only the
Halide::
andhalide_
symbols in our shared libraries, hiding everything else (most notable, everything LLVM).It doesn't attempt to do the same for MSVC builds (yet). Even without that, though, this is arguably strictly better than what we had before.
Marking as "draft" for now because the CMake scripting is awful but I didn't want to wait to figure out the right CMake syntax before trying this out. And also, some ugly TODOs and stuff.