mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +00:00
Have cosmo_dlopen() request -z execstack
on Linux
The AMD HIP SDK for Linux ships prebuilt DSOs with an RWX PT_GNU_STACK since old versions of GCC made it nearly impossible to build artifacts where that wasn't the case, however modern glibc systems will flat out refuse to link RWX DSOs from an execuatble that uses PT_GNU_STACK = RW
This commit is contained in:
parent
531ac85923
commit
5ae2554c10
1 changed files with 9 additions and 1 deletions
|
@ -618,7 +618,15 @@ static dontinline bool foreign_compile(char exe[hasatleast PATH_MAX]) {
|
|||
}
|
||||
int pid, ws;
|
||||
char *args[] = {
|
||||
"cc", "-pie", "-fPIC", src, "-o", tmp, IsNetbsd() ? 0 : "-ldl", 0,
|
||||
"cc",
|
||||
"-pie",
|
||||
"-fPIC",
|
||||
src,
|
||||
"-o",
|
||||
tmp,
|
||||
IsLinux() ? "-Wl,-z,execstack" : "-DIGNORE",
|
||||
IsNetbsd() ? 0 : "-ldl",
|
||||
0,
|
||||
};
|
||||
errno_t err = posix_spawnp(&pid, args[0], NULL, NULL, args, environ);
|
||||
if (err) {
|
||||
|
|
Loading…
Reference in a new issue