Re: [PATCH 13/21] ARC: Build Infrastructure

2019-01-29 Thread Vineet Gupta
On 12/20/18 3:24 PM, Joseph Myers wrote:
> On Thu, 20 Dec 2018, Vineet Gupta wrote:
> 
>> On 12/19/18 2:17 PM, Joseph Myers wrote:
>>> I should note a separate issue to consider: that of *static* PIE support.  
>>> That doesn't need to be working, but if it's not working,
>>
>> Aren't there directed test cases for that already ?
>>
>> PASS: elf/tst-tls1-static
>> PASS: elf/tst-tls1-static-non-pie
>> FAIL: gmon/tst-gmon-pie-gprof
> 
> The key point on the PortStatus page is "If linker can correctly generate 
> static PIE, glibc test results should be identical with and without 
> --enable-static-pie.".  You need to test a build configured with 
> --enable-static-pie to see if this is fully working.

Unfortunately this doesn't seem to work.

ld bails out when linking elf/sln. It can't seem to resolve the _DYNAMIC@pcl in
elf_machine_load_address(). We can look into this but presume it is not a deal
breaker.


~/BR/host/bin/arc-buildroot-linux-gnu-gcc
-nostdlib -nostartfiles
*-static*
-o ~/BR/build/glibc-2f9a78f208a7/build/elf/sln
*-static-pie*
~/BR/build/glibc-2f9a78f208a7/build/csu/rcrt1.o
~/BR/build/glibc-2f9a78f208a7/build/csu/crti.o
`~/BR/host/bin/arc-buildroot-linux-gnu-gcc  --print-file-name=crtbeginS.o`
~/BR/build/glibc-2f9a78f208a7/build/elf/sln.o
~/BR/build/glibc-2f9a78f208a7/build/elf/static-stubs.o
-Wl,--start-group
~/BR/build/glibc-2f9a78f208a7/build/libc.a -lgcc
-Wl,--end-group
`~/BR/host/bin/arc-buildroot-linux-gnu-gcc  --print-file-name=crtendS.o`
~/BR/build/glibc-2f9a78f208a7/build/csu/crtn.o

~/BR/host/lib/gcc/arc-buildroot-linux-gnu/8.2.1/../../../../arc-buildroot-linux-gnu/bin/ld:
~/BR/build/glibc-2f9a78f208a7/build/libc.a(dl-reloc-static-pie.o): in function
`elf_machine_load_address':
~/BR/build:/glibc-2f9a78f208a7/elf/../sysdeps/arc/dl-machine.h:115: undefined
reference to `_DYNAMIC'
~/BR/host/lib/gcc/arc-buildroot-linux-gnu/8.2.1/../../../../arc-buildroot-linux-gnu/bin/ld:
~/BR/build/glibc-2f9a78f208a7/elf/../sysdeps/arc/dl-machine.h:115: undefined
reference to `_DYNAMIC'
collect2: error: ld returned 1 exit status

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 13/21] ARC: Build Infrastructure

2018-12-20 Thread Joseph Myers
On Thu, 20 Dec 2018, Vineet Gupta wrote:

> On 12/19/18 2:17 PM, Joseph Myers wrote:
> > I should note a separate issue to consider: that of *static* PIE support.  
> > That doesn't need to be working, but if it's not working,
> 
> Aren't there directed test cases for that already ?
> 
> PASS: elf/tst-tls1-static
> PASS: elf/tst-tls1-static-non-pie
> FAIL: gmon/tst-gmon-pie-gprof

The key point on the PortStatus page is "If linker can correctly generate 
static PIE, glibc test results should be identical with and without 
--enable-static-pie.".  You need to test a build configured with 
--enable-static-pie to see if this is fully working.

-- 
Joseph S. Myers
jos...@codesourcery.com

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 13/21] ARC: Build Infrastructure

2018-12-20 Thread Vineet Gupta
On 12/19/18 2:17 PM, Joseph Myers wrote:
> I should note a separate issue to consider: that of *static* PIE support.  
> That doesn't need to be working, but if it's not working,

Aren't there directed test cases for that already ?

PASS: elf/tst-tls1-static
PASS: elf/tst-tls1-static-non-pie
FAIL: gmon/tst-gmon-pie-gprof

I vaguely remember binutils folks fixing some pie issues when above became PASS

> or if you don't 
> know whether it's working, when the port goes in you need to update the 
> list at  accordingly.  (Port 
> maintainers need to make sure 
>  and 
>  are up to date for their 
> ports, as well as posting test results on the per-release wiki page during 
> each release cycle's freeze period.)

Will do when we get there :-)

Thx,
-Vineet


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 13/21] ARC: Build Infrastructure

2018-12-19 Thread Joseph Myers
On Wed, 19 Dec 2018, Vineet Gupta wrote:

> Indeed with current glibc port, we do build/test/run a bunch of packages 
> relying on PIE (dumpcap, openssh come to mind) successfully. So yes PIE 
> should work in general for ARC now. FWIW this could also explain the 
> following current results.

I should note a separate issue to consider: that of *static* PIE support.  
That doesn't need to be working, but if it's not working, or if you don't 
know whether it's working, when the port goes in you need to update the 
list at  accordingly.  (Port 
maintainers need to make sure 
 and 
 are up to date for their 
ports, as well as posting test results on the per-release wiki page during 
each release cycle's freeze period.)

-- 
Joseph S. Myers
jos...@codesourcery.com

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 13/21] ARC: Build Infrastructure

2018-12-19 Thread Vineet Gupta
On 12/18/18 3:44 PM, Joseph Myers wrote:
> On Tue, 18 Dec 2018, Vineet Gupta wrote:
> 
>> +libc {
>> +  GLIBC_2.29 {
>> +__adddf3; __addsf3; __divdf3; __divsf3; __eqdf2; __eqsf2; __extendsfdf2;
>> +__fixdfdi; __fixdfsi; __fixsfdi; __fixsfsi;
>> +__fixunsdfdi; __fixunsdfsi; __fixunssfdi; __fixunssfsi;
>> +__floatdidf; __floatdisf; __floatsidf; __floatsisf;
>> +__floatundidf; __floatundisf; __floatunsidf; __floatunsisf;
>> +__gedf2; __gesf2; __gtdf2; __gtsf2; __ledf2; __lesf2; __ltdf2; __ltsf2;
>> +__muldf3; __mulsf3; __nedf2; __nesf2; __negdf2; __negsf2;
>> +__subdf3; __subsf3; __truncdfsf2; __unorddf2; __unordsf2;
>
> Exporting soft-fp symbols from glibc is only appropriate if you are also 
> building soft-fp in glibc (as opposed to building it in libgcc) - which 
> might be done with a view to possibly enabling support for exceptions and 
> rounding modes for soft-float, as on powerpc soft-float, for example.  I 
> don't see a Subdirs files containing "soft-fp" in this patch series.  If 
> you're just linking with libgcc, you should not be re-exporting these 
> functions from libc.so (and indeed I don't see them in your ABI baselines 
> - libgcc.a has them as hidden symbols to prevent such re-exporting).

Removed now !

>> +libc_cv_fpie=no
> Why? 

This likely goes back to my original work on glibc (started somewhere in 2015),
and at the time binutils support for PIE was really shaky (to speak mildly). It
was only in ARC GNU 2016.09 release did we have serious pie fixes due to 
essential
rewrite of binutils backend by Cuper and Claudiu.

> I'd expect -fpie to be working for all glibc architectures with any 
> modern GCC version (I wouldn't expect it to need extra GCC back-end 
> support beyond -fpic).

Well at the time there were multiple PIE related issues in binutils rather than 
gcc.

Indeed with current glibc port, we do build/test/run a bunch of packages relying
on PIE (dumpcap, openssh come to mind) successfully. So yes PIE should work in
general for ARC now. FWIW this could also explain the following current results.

PASS: gmon/tst-gmon-gprof
FAIL: gmon/tst-gmon-pie-gprof

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 13/21] ARC: Build Infrastructure

2018-12-18 Thread Joseph Myers
On Tue, 18 Dec 2018, Vineet Gupta wrote:

> +libc {
> +  GLIBC_2.29 {
> +__adddf3; __addsf3; __divdf3; __divsf3; __eqdf2; __eqsf2; __extendsfdf2;
> +__fixdfdi; __fixdfsi; __fixsfdi; __fixsfsi;
> +__fixunsdfdi; __fixunsdfsi; __fixunssfdi; __fixunssfsi;
> +__floatdidf; __floatdisf; __floatsidf; __floatsisf;
> +__floatundidf; __floatundisf; __floatunsidf; __floatunsisf;
> +__gedf2; __gesf2; __gtdf2; __gtsf2; __ledf2; __lesf2; __ltdf2; __ltsf2;
> +__muldf3; __mulsf3; __nedf2; __nesf2; __negdf2; __negsf2;
> +__subdf3; __subsf3; __truncdfsf2; __unorddf2; __unordsf2;

Exporting soft-fp symbols from glibc is only appropriate if you are also 
building soft-fp in glibc (as opposed to building it in libgcc) - which 
might be done with a view to possibly enabling support for exceptions and 
rounding modes for soft-float, as on powerpc soft-float, for example.  I 
don't see a Subdirs files containing "soft-fp" in this patch series.  If 
you're just linking with libgcc, you should not be re-exporting these 
functions from libc.so (and indeed I don't see them in your ABI baselines 
- libgcc.a has them as hidden symbols to prevent such re-exporting).

> +libc_cv_fpie=no

Why?  I'd expect -fpie to be working for all glibc architectures with any 
modern GCC version (I wouldn't expect it to need extra GCC back-end 
support beyond -fpic).

-- 
Joseph S. Myers
jos...@codesourcery.com

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc