libbsd: Branch 'main' - 3 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat Nov 27 05:55:36 UTC 2021
.gitignore | 1 +
configure.ac | 2 +-
src/setproctitle_ctor.c | 2 +-
test/nlist.c | 6 +++---
4 files changed, 6 insertions(+), 5 deletions(-)
New commits:
commit 7389fe8d243989f40900a4bbba4e493c8bd114f7
Author: Guillem Jover <guillem at hadrons.org>
Date: Sat Nov 27 06:54:49 2021 +0100
build: Ignore backup files
diff --git a/.gitignore b/.gitignore
index bece823..460667b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
ChangeLog
+*~
*.pc
*.la
*.lo
commit 2716dfd0b7d570b6a6cbba8a4a7bc9e538d0520c
Author: Victor Westerhuis <victor at westerhu.is>
Date: Fri Nov 26 20:24:20 2021 +0100
test: Explicitly mark symbols as used
Because some of the symbols are not otherwise referenced, GCC would like
to remove them.
Closes: !14
Signed-off-by: Guillem Jover <guillem at hadrons.org>
diff --git a/test/nlist.c b/test/nlist.c
index a2ac228..558524f 100644
--- a/test/nlist.c
+++ b/test/nlist.c
@@ -39,11 +39,11 @@ extern int data_pub_uninit[2048];
extern int *data_pub_ptr;
int *data_pub_ptr = &data_prv_init;
-int data_pub_init = 10;
-int data_pub_uninit[2048];
+int data_pub_init __attribute__((__used__)) = 10;
+int data_pub_uninit[2048] __attribute__((__used__));
extern int
-func_pub(void);
+func_pub(void) __attribute__((__used__)) ;
int
func_pub(void)
commit 54f874565716766d6453ff050d78c70ea326d89a
Author: Victor Westerhuis <victor at westerhu.is>
Date: Fri Nov 26 20:01:18 2021 +0100
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 at hadrons.org>
diff --git a/configure.ac b/configure.ac
index 645a95b..806b7d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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; }
]]
)],
diff --git a/src/setproctitle_ctor.c b/src/setproctitle_ctor.c
index 2c5b6d0..f25dbfc 100644
--- a/src/setproctitle_ctor.c
+++ b/src/setproctitle_ctor.c
@@ -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;
More information about the libbsd
mailing list