add -dead_strip_dylibs by default to the macOS linker

Under macOS, to reduce dependency chains, we remove functions and
data that are unreachable by the entry point or exported symbols.
In particular, the linker is run with "-dead_strip" and with
"-dead_strip_dylibs".
This commit is contained in:
Landon Curt Noll
2023-08-14 04:11:33 -07:00
parent ee900ec6ec
commit e0df1646fc
12 changed files with 51 additions and 26 deletions

View File

@@ -91,6 +91,16 @@ custom(char *name, int count, VALUE **vals)
}
}
/*
* validate custtbl_allowed value
*/
if (custtbl_allowed == 0) {
fprintf(stderr,
"%sCalc was built with custom functions enabled but custtbl_allowed is 0\n",
(conf->tab_ok ? "\t" : ""));
return error_value(E_NO_CUSTOM);
}
/*
* no such custom function
*/
@@ -107,6 +117,15 @@ custom(char *name, int count, VALUE **vals)
(conf->tab_ok ? "\t" : ""), name, count,
(vals == NULL) ? "NULL" : "non-NULL");
}
/*
* validate custtbl_allowed value
*/
if (custtbl_allowed != 0) {
fprintf(stderr,
"%sCalc was built with custom functions disabled but custtbl_allowed is != 0\n",
(conf->tab_ok ? "\t" : ""));
}
return error_value(E_NO_CUSTOM);
#endif /* CUSTOM */