> Ooh boy, why would you do this? When there's a perfectly good -lgmp just waiting for you.
Usage of "/usr/lib/libgmp.a" directly is not forbidden by any toolchain or build system. Moreover it is recommended by cmake. You can google for "target_link_libraries( site:
github.com" and found millions of software that uses something like:
find_library(EXTERNAL_LIB)
target_link_libraries(something ${EXTERNAL_LIB_FOUND})
> The warning is justified, you usually do not want to do this. With a TEXTREL, the code has to be mapped as writable, so now programming errors and exploits can change the executable code.
This is warning from ld, not from musl. Segfault is not an acceptable message from libc. Libc should not try to write into readonly pointer.
> Well, the remedy is obvious: Get rid of the TEXTREL.
Yes, I've found a workaround: "USE='-asm' emerge -v1 gmp", assembly is broken, will report it to gmp upstream. But this is not a fix for the issue.
> Iterate over the apps PHDRs and remove write protection from all RO segments?
So libc knows that file is mapped as readonly and should not try to write into readonly pointers. Libc can do the following:
1. Ignore impossible relocations.
2. Add a warning to stderr and still ignore impossible relocations.
3. do abort, user will receive SIGABRT and understand that he uses libc in a wrong way.
Segfault is not an acceptable answer.
Thank you.