summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Rosin <peda@lysator.liu.se>2014-05-02 14:51:02 +0200
committerPeter Rosin <peda@lysator.liu.se>2014-05-02 14:52:30 +0200
commit5911665520a53415bafd8bb6da9989b5fe25df80 (patch)
tree50746c8864e13ef4426cdca7b9bc5a09d0daf8bf
parent053df7eb31d21c6d6dbe54c44f42009efec9d0c9 (diff)
downloadlibtool-5911665520a53415bafd8bb6da9989b5fe25df80.tar.gz
libtool: prevent lto from stripping the magic cookie from the cwrapper
Whole program optimization may remove unused symbols unless told they are really needed. Fixes sr #108559 reported by LRN. * build-aux/ltmain.in (func_emit_cwrapperexe_src:MAGIC_EXE): Try to ensure that the magic cookie is preserved. Signed-off-by: Peter Rosin <peda@lysator.liu.se>
-rw-r--r--build-aux/ltmain.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index f8e0f5fb..3a0fb0c5 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -3738,7 +3738,12 @@ void lt_dump_script (FILE *f);
EOF
cat <<EOF
-volatile const char * MAGIC_EXE = "$magic_exe";
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+# define externally_visible volatile
+#else
+# define externally_visible __attribute__((externally_visible)) volatile
+#endif
+externally_visible const char * MAGIC_EXE = "$magic_exe";
const char * LIB_PATH_VARNAME = "$shlibpath_var";
EOF