Bug ID 1115034
Summary gnatmake broken when gcc-PIE is installed
Classification openSUSE
Product openSUSE Distribution
Version Leap 15.0
Hardware Other
OS Other
Status NEW
Severity Normal
Priority P5 - None
Component Development
Assignee bnc-team-screening@forge.provo.novell.com
Reporter tdevries@suse.com
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

Consider this test-case:
...
$ cat hello.adb 
with Ada.Text_IO;

procedure Hello is
begin
   Ada.Text_IO.Put_Line("Hello, world!");
end Hello;
...

We're able to compile this using gnatmake:
...
$ rm -f hello.ali hello.o hello ; gnatmake -v hello.adb -largs -v   

GNATMAKE 8.2.1 20180831 [gcc-8-branch revision 264010]
Copyright (C) 1992-2018, Free Software Foundation, Inc.
  "hello.ali" being checked ...
  -> "hello.ali" missing.
gcc -c hello.adb
End of compilation
gnatbind -x hello.ali
gnatlink hello.ali -v

GNATLINK 8.2.1 20180831 [gcc-8-branch revision 264010]
Copyright (C) 1995-2018, Free Software Foundation, Inc.
gcc -c -gnatA -gnatWb -gnatiw -gnatws /root/b~hello.adb
/usr/bin/gcc b~hello.o ./hello.o -o hello -L./
-L/usr/lib64/gcc/x86_64-suse-linux/8/adalib/
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a -ldl -static-libgcc
...

And then run it:
...
$ ./hello 
Hello, world!
...

However, when we install gcc-PIE:
...
$ sudo zypper install gcc-PIE
...

we get a gnatlink error instead:
...
$ rm -f hello.ali hello.o hello ; gnatmake -v hello.adb -largs -v

GNATMAKE 8.2.1 20180831 [gcc-8-branch revision 264010]
Copyright (C) 1992-2018, Free Software Foundation, Inc.
  "hello.ali" being checked ...
  -> "hello.ali" missing.
gcc -c hello.adb
End of compilation
gnatbind -x hello.ali
gnatlink hello.ali -v

GNATLINK 8.2.1 20180831 [gcc-8-branch revision 264010]
Copyright (C) 1995-2018, Free Software Foundation, Inc.
gcc -c -gnatA -gnatWb -gnatiw -gnatws /root/b~hello.adb
/usr/bin/gcc b~hello.o ./hello.o -o hello -L./
-L/usr/lib64/gcc/x86_64-suse-linux/8/adalib/
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a -ldl -static-libgcc
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(a-contai.o): relocation
R_X86_64_32 against symbol `ada__containers__capacity_error' can not be used
when making a PIE object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(a-except.o): relocation
R_X86_64_32S against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(a-finali.o): relocation
R_X86_64_32S against symbol `ada__finalization__controlledT' can not be used
when making a PIE object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(a-ioexce.o): relocation
R_X86_64_32 against symbol `ada__io_exceptions__status_error' can not be used
when making a PIE object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(a-stmaco.o): relocation
R_X86_64_32S against symbol `ada__strings__maps__constants__A3s' can not be
used when making a PIE object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(a-stream.o): relocation
R_X86_64_32S against symbol `ada__streams__root_stream_typeT' can not be used
when making a PIE object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(a-string.o): relocation
R_X86_64_32 against symbol `ada__strings__length_error' can not be used when
making a PIE object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(a-strmap.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(a-tags.o): relocation
R_X86_64_32S against symbol `ada__tags__external_tag_htable__tableXn' can not
be used when making a PIE object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(a-textio.o): relocation
R_X86_64_32S against symbol `ada__text_io__text_afcbT' can not be used when
making a PIE object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-trasym.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(i-c.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-bitops.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-boustr.o): relocation
R_X86_64_32S against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-except.o): relocation
R_X86_64_32 against symbol `system__exceptions__foreign_exception' can not be
used when making a PIE object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-exctab.o): relocation
R_X86_64_32S against symbol `system__exception_table__htable' can not be used
when making a PIE object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-ficobl.o): relocation
R_X86_64_32S against symbol `system__file_control_block__afcbT' can not be used
when making a PIE object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-fileio.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-finroo.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-memory.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-os_lib.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-secsta.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-soflin.o): relocation
R_X86_64_32 against symbol `ada__exceptions__null_occurrence' can not be used
when making a PIE object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-valllu.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-valuti.o): relocation
R_X86_64_32 against symbol `constraint_error' can not be used when making a PIE
object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-wchcon.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-wchjis.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-wchstw.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-objrea.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-dwalin.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-mmap.o): relocation
R_X86_64_32S against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-mmosin.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(adadecode.o): relocation
R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(adaint.o): relocation
R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(cio.o): relocation
R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(env.o): relocation
R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(init.o): relocation
R_X86_64_32S against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(sysdep.o): relocation
R_X86_64_32 against undefined symbol `cap_get_proc' can not be used when making
a PIE object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(tracebak.o): relocation
R_X86_64_32 against `.text' can not be used when making a PIE object; recompile
with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(raise-gcc.o): relocation
R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(a-chahan.o): relocation
R_X86_64_32S against symbol `ada__characters__handling__char_map' can not be
used when making a PIE object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(a-elchha.o): relocation
R_X86_64_32S against symbol `system__soft_links__task_termination_nt' can not
be used when making a PIE object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-exctra.o): relocation
R_X86_64_32 against `.text' can not be used when making a PIE object; recompile
with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a(s-addima.o): relocation
R_X86_64_32S against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: final
link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
gnatlink: error when calling /usr/bin/gcc
gnatmake: *** link failed.
$
...

The compilation fails because gnatlink uses
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat.a instead of
/usr/lib64/gcc/x86_64-suse-linux/8/adalib/libgnat_pic.a.


You are receiving this mail because: