aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-opts.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-01-06 16:51:45 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2019-01-06 15:51:45 +0000
commit700efa31a80bebd6843ef92ecea4c23dff2eb252 (patch)
treedb7c594ac6ea92fb586c7bf866d8e66990d23c3e /gcc/lto-opts.c
parent4ce8047468f798e92ed79e900a2d9ced2a7032c5 (diff)
downloadgcc-700efa31a80bebd6843ef92ecea4c23dff2eb252.zip
gcc-700efa31a80bebd6843ef92ecea4c23dff2eb252.tar.gz
gcc-700efa31a80bebd6843ef92ecea4c23dff2eb252.tar.bz2
re PR lto/86517 (relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object with LTO)
PR lto/86517 PR lto/88185 * lto-opts.c (lto_write_options): Always stream PIC/PIE mode. * lto-wrapper.c (merge_and_complain): Fix merging of PIC/PIE. From-SVN: r267610
Diffstat (limited to 'gcc/lto-opts.c')
-rw-r--r--gcc/lto-opts.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c
index ea336ad..527045f 100644
--- a/gcc/lto-opts.c
+++ b/gcc/lto-opts.c
@@ -78,6 +78,21 @@ lto_write_options (void)
&& !global_options.x_flag_openacc)
append_to_collect_gcc_options (&temporary_obstack, &first_p,
"-fno-openacc");
+ /* Append PIC/PIE mode because its default depends on target and it is
+ subject of merging in lto-wrapper. */
+ if (!global_options_set.x_flag_pic && !global_options_set.x_flag_pie)
+ {
+ append_to_collect_gcc_options (&temporary_obstack, &first_p,
+ global_options.x_flag_pic == 2
+ ? "-fPIC"
+ : global_options.x_flag_pic == 1
+ ? "-fpic"
+ : global_options.x_flag_pie == 2
+ ? "-fPIE"
+ : global_options.x_flag_pie == 1
+ ? "-fpie"
+ : "-fno-pie");
+ }
/* Append options from target hook and store them to offload_lto section. */
if (lto_stream_offload_p)