This enables the use of this script from other build systems like
GN which don't support post-build actions as well as for static
archives.
Details
Diff Detail
- Repository
- rCXX libc++
Event Timeline
Nice! argparse makes this a lot simpler :)
libcxx/utils/gen_link_script.py | ||
---|---|---|
7 ↗ | (On Diff #193837) | I think the LHS license is the new license – probably want to keep the new license? |
36 ↗ | (On Diff #193837) | stray debugging leftover? |
38 ↗ | (On Diff #193837) | The LHS didn't do this. Is this for Windows? |
41 ↗ | (On Diff #193837) | Probably don't want to do this if args.dryrun |
62 ↗ | (On Diff #193837) | We're losing this error, is this intentional? |
While we're at it, do you know why the LIBCXX_ENABLE_ABI_LINKER_SCRIPT isn't allowed on Apple platforms? It doesn't seem to me like this is something you'd want to necessarily prevent on Apple platforms.
Looks good to me too except for the elif not os.path.exists(args.input): which I don't understand what it's for.
libcxx/utils/gen_link_script.py | ||
---|---|---|
38 ↗ | (On Diff #193837) | (unreplied) |
62 ↗ | (On Diff #193837) | We're still losing this? I assume it's intentional, but might want to say why you're changing behavior here somewhere. |
My point is just that you might want to create/test the creation of the linker script on Darwin. Also, you could potentially be building for a Unix on an Apple platform.
I mean crosscompiling _from_ an Apple platform.
The restriction just appeared artificial to me, that's all.
libcxx/utils/gen_link_script.py | ||
---|---|---|
7 ↗ | (On Diff #193837) | That's unintentional, I just copied the file from the original patch and forgot to update the header. |
38 ↗ | (On Diff #193837) | It's for the static case, where the input would be libc++static.a and output would be libc++.a, but libc++.a is what's actually being produced by the CMake, in that case the script is going to rename libc++.a to libc++static.a and generate libc++.a linker script. The --input and --output argument names are a bit misleading in that case, maybe something like --library and --link-script would be better? |
62 ↗ | (On Diff #193837) | This is intentional because in cases like the static library, there's no symlink. |
Cross-compiling works, we use it in our build when building Fuchsia runtimes on Apple platforms, so it's only when targeting Apple platform that's unsupported.
libcxx/utils/gen_link_script.py | ||
---|---|---|
38 ↗ | (On Diff #193837) | I forgot to press reply. |
Might want to mention in the commit message that this adds support for the static library chase. Is there no way to make cmake call the static lib c++static.a though? Having this script rename the build system's build output is a bit weird.
I've cleaned up that part of the script since we don't really need the static library support yet.