On 2025-12-14 5:05 AM, Florian Weimer wrote:
* Gordon Messmer:
I'd like to define an ldflags macro containing -rpath with $ORIGIN and
$LIB, but as far as I can tell, there is no way to escape those values
that will work for all build systems. Am I missing an option?
The “all build systems” requirement is pretty wide.  Not every linker we
have supports -rpath.  Could you narrow it down a bit?


Let's set aside other linkers for a moment...

If I want to run something like "mock ... --define '_pkg_extra_ldflags -Wl,-rpath,$ORIGIN/../$LIB' --rebuild <src.rpm>" for an autotools project, the value of that ldflags macro is going to end up in a Makefile, where '$' will be interpreted as the beginning of a variable. So, to use $ORIGIN in an autotools project, I need to escape the '$' characters. But something like a python module with an extension doesn't use make, so I have to escape that character in a different way.

It's possible that I'm missing a generic solution, but the one that comes to mind is to write ldflags to a file and use -specs to pass the arguments without the '$' being interpreted by the build system.


--
_______________________________________________
devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to