reinplacing -Wl,-foo,bar to "-foo bar"?

René J.V. Bertin rjvbertin at gmail.com
Wed Apr 26 15:13:22 UTC 2023


Hi,

This is a little problem I'm grappling with on Linux, but it could be of interest for others. I need the set `configure.ld` to the actual linker (say $prefix/bin/ld) because that's what the build system in question expects (here: rustc) because it passes flags that aren't understood by gcc or clang.

So in this case, the compiler_wrapper PG cannot pass on ${configure.ldflags} in the script, not "as is" in any case.

The best approach I see at this point is an option to rewrite the linker wrapper in that PG, unwrapping the -Wl,-foo,bar[,...] options. I know what regexp to use for that in vi (some sequence of versions of `s/-Wl,\([^,]*\),\([^,]*\)/\1 \2/g`) , but apparently sed has a slightly different syntax.
I'll probably get there, but in anyone has the magic formula handy I'd appreciate it.

Thanks
R.


More information about the macports-dev mailing list