mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-08 11:02:24 +01:00
build: Enable .init_array support when building with LTO
Because these symbols are not otherwise referenced, GCC would like to remove them. Signed-off-by: Guillem Jover <guillem@hadrons.org>
This commit is contained in:
parent
428be9e030
commit
54f8745657
@ -175,7 +175,7 @@ AC_CACHE_CHECK(
|
||||
[[
|
||||
static int rc = 1;
|
||||
static void init(int argc) { if (argc == 1) rc = 0; }
|
||||
void (*init_func)(int argc) __attribute__((__section__(".init_array"))) = init;
|
||||
void (*init_func)(int argc) __attribute__((__section__(".init_array"), __used__)) = init;
|
||||
int main() { return rc; }
|
||||
]]
|
||||
)],
|
||||
|
@ -49,4 +49,4 @@
|
||||
* move them from .ctors to .init_array.
|
||||
*/
|
||||
void (*libbsd_init_func)(int argc, char *argv[], char *envp[])
|
||||
__attribute__((__section__(".init_array"))) = setproctitle_init;
|
||||
__attribute__((__section__(".init_array"), __used__)) = setproctitle_init;
|
||||
|
Loading…
Reference in New Issue
Block a user