#3668: PIE-enabled hardened gcc might broke GHC.
--------------------------+-------------------------------------------------
 Reporter:  secludedsage  |          Owner:        
     Type:  bug           |         Status:  new   
 Priority:  normal        |      Milestone:        
Component:  Compiler      |        Version:  6.10.4
 Severity:  normal        |     Resolution:        
 Keywords:                |       Testcase:        
       Os:  Linux         |   Architecture:  x86   
--------------------------+-------------------------------------------------
Comment (by secludedsage):

 gcc -dumpspecs:
 *asm:
 %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}

 *asm_debug:
 %{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}} %{fdebug-prefix-map
 =*:--debug-prefix-map %*}

 *asm_final:


 *asm_options:
 %{--target-help:%:print-asm-header()} %a %Y %{c:%W{o*}%{!o*:-o
 %w%b%O}}%{!c:-o %d%w%u%O}

 *invoke_as:
 %{!S:-o %|.s |
  as %(asm_options) %|.s %A }

 *cpp:
 %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}

 *cpp_options:
 %(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}
 %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*}
 %{undef} %{save-temps:-fpch-preprocess}

 *cpp_debug_options:
 %{d*}

 *cpp_unique_options:
 %{C|CC:%{!E:%eGCC does not support -C or -CC without -E}} %{!Q:-quiet}
 %{nostdinc*} %{C} %{CC} %{v} %{I*&F*} %{P} %I %{MD:-MD
 %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*}
 %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ
 %*}}}}}}} %{remap} %{g3|ggdb3|gstabs3|gcoff3|gxcoff3|gvms3:-dD} %{H} %C
 %{D*&U*&A*} %{i*} %Z %i %{fmudflap:-D_MUDFLAP -include mf-runtime.h}
 %{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h}
 
%{!D_FORTIFY_SOURCE:%{!D_FORTIFY_SOURCE=*:%{!U_FORTIFY_SOURCE:-D_FORTIFY_SOURCE=2}}}
 %{E|M|MM:%W{o*}}

 *trad_capable_cpp:
 cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}

 *cc1:
 %(cc1_cpu) %{profile:-p}%{!D__KERNEL__: %(cc1_pie) %(cc1_ssp) }
 %(cc1_strict)

 *cc1_options:
 %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are
 incompatible}} %{shared:%{static|pie|fPIE|fpie|fno-PIC|fno-pic:%e-shared
 and -static|pie|fPIE|fpie|fno-PIC|fno-pic are incompatible}}
 %{pie:%{static|pg|p|profile:%e-pie and -static|pg|p|profile are
 incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{c|S:%{o
 *:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*}
 %{W*&pedantic*} %{w} %{std*&ansi&trigraphs} %{v:-version} %{pg:-p} %{p}
 %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-
 help} %{--help=*:--help=%(VALUE)} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o
 %b.s}}} %{fsyntax-only:-o %j} %{-param*} %{fmudflap|fmudflapth:-fno-
 builtin -fno-merge-constants} %{coverage:-fprofile-arcs -ftest-coverage}

 *cc1plus:


 *link_gcc_c_sequence:
 %{static:--start-group} %G %L %{static:--end-group}%{!static:%G}

 *link_ssp:
 %{fstack-protector:}

 *endfile:
 %{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}
 %{mpc32:crtprec32.o%s}    %{mpc64:crtprec64.o%s}    %{mpc80:crtprec80.o%s}
 %(endfile_pie_gen) crtn.o%s

 *link:
 %{!static:--eh-frame-hdr} -m %(link_emulation) %{shared:-shared}
 %{!shared:     %{!ibcs:       %{!static:     %{rdynamic:-export-dynamic}
 %{!dynamic-linker:-dynamic-linker %(dynamic_linker)}}
 %{static:-static}}}

 *lib:
 %{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{mieee-fp:-lieee}
 %{profile:-lc_p}%{!profile:-lc}}

 *mfwrap:
  %{static: %{fmudflap|fmudflapth:  --wrap=malloc --wrap=free --wrap=calloc
 --wrap=realloc --wrap=mmap --wrap=munmap --wrap=alloca} %{fmudflapth:
 --wrap=pthread_create}} %{fmudflap|fmudflapth: --wrap=main}

 *mflib:
 %{fmudflap|fmudflapth: -export-dynamic}

 *link_gomp:


 *libgcc:
 %{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc
 :%{!shared-libgcc:-lgcc --as-needed -lgcc_s --no-as-needed}%{shared-
 libgcc:-lgcc_s%{!shared: -lgcc}}}}

 *startfile:
 %(ld_pie_crtfile_gen) crti.o%s %(startfile_pie_t_gen)

 *switches_need_spaces:


 *cross_compile:
 0

 *version:
 4.3.4

 *multilib:
 . ;

 *multilib_defaults:


 *multilib_extra:


 *multilib_matches:


 *multilib_exclusions:


 *multilib_options:


 *linker:
 collect2

 *link_libgcc:
 %D

 *md_exec_prefix:


 *md_startfile_prefix:


 *md_startfile_prefix_1:


 *startfile_prefix_spec:


 *sysroot_spec:
 --sysroot=%R

 *sysroot_suffix_spec:


 *sysroot_hdrs_suffix_spec:


 *asm_pie:
 %{pie:-K PIC}

 *ld_pie_crtfile_gen:
 %(crtfile_pie_gen)

 *crtfile_gen:
 %{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}}

 *crtfile_pie_gen:
 %{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s} }

 *startfile_pie_t_gen:
 %{shared|pie:crtbeginS.o%s;static:crtbeginT.o%s;:crtbegin.o%s}

 *startfile_pie_gen:
 %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}

 *endfile_pie_gen:
 %{shared|pie:crtendS.o%s;:crtend.o%s}

 *cc1_ssp:


 *cc1_ssp_all:


 *cc1_pie:
 %{pie:-fPIE}

 *cc1_strict:


 *link_now:


 *link_pie:
 %{pie:-pie}

 *cc1_cpu:
 %{mcpu=*:-mtune=%* %n`-mcpu=' is deprecated. Use `-mtune=' or '-march='
 instead.
 } %<mcpu=* %{mintel-syntax:-masm=intel %n`-mintel-syntax' is deprecated.
 Use `-masm=intel' instead.
 } %{mno-intel-syntax:-masm=att %n`-mno-intel-syntax' is deprecated. Use
 `-masm=att' instead.
 }%{march=native:%<march=native %:local_cpu_detect(arch)
 %{!mtune=*:%<mtune=native %:local_cpu_detect(tune)}}
 %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}

 *link_emulation:
 elf_i386

 *dynamic_linker:
 %{muclibc:%{mglibc:%e-mglibc and -muclibc used together}/lib/ld-
 uClibc.so.0;:/lib/ld-linux.so.2}

 *link_command:
 %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %(link_pie)
 %(link_now) %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}    %{s} %{t}
 %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:}
 %{L*} %(mfwrap) %(link_libgcc) %o    %{fopenmp|ftree-parallelize-
 loops=*:%:include(libgomp.spec)%(link_gomp)} %(mflib)    %{fprofile-arcs
 |fprofile-generate|coverage:-lgcov}
 %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}
 %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3668#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to