Add -Wl,-install_name macOS clang compatible flag as clang refuses -Wl,-soname. This helps configure scripts using both clang and tcc.

This commit is contained in:
Christian Jullien 2022-12-24 09:30:00 +01:00
parent 3fd6a05fff
commit 95e39517ef
2 changed files with 5 additions and 0 deletions

View File

@ -1450,6 +1450,8 @@ static int tcc_set_linker(TCCState *s, const char *option)
s->section_align = strtoul(p, &end, 16);
} else if (link_option(option, "soname=", &p)) {
copy_linker_arg(&s->soname, p, 0);
} else if (link_option(option, "install_name=", &p)) {
copy_linker_arg(&s->soname, p, 0);
#ifdef TCC_TARGET_PE
} else if (link_option(option, "large-address-aware", &p)) {
s->pe_characteristics |= 0x20;

3
tcc.c
View File

@ -142,6 +142,9 @@ static const char help2[] =
" -rpath= set dynamic library search path\n"
" -enable-new-dtags set DT_RUNPATH instead of DT_RPATH\n"
" -soname= set DT_SONAME elf tag\n"
#if defined(TCC_TARGET_MACHO)
" -install_name= set DT_SONAME elf tag (soname macOS alias)\n"
#endif
" -Bsymbolic set DT_SYMBOLIC elf tag\n"
" -oformat=[elf32/64-* binary] set executable output format\n"
" -init= -fini= -Map= -as-needed -O (ignored)\n"