Re: [EXTERNAL] Re: How to test aarch64 when building a cross-compiler?

2019-11-27 Thread Andreas Schwab
On Nov 27 2019, Andrew Dean via gcc wrote:

> 2. export 
> LD_LIBRARY_PATH=${BuildRoot}/install/glibcs/aarch64-linux-gnu/lib64:${BuildRoot}/install/compilers/aarch64-linux-gnu/aarch64-glibc-linux-gnu/lib64
>  
> 3. sudo ln -s 
> ${BuildRoot}/install/glibcs/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1 
> /lib/ld-linux-aarch64.so.1

Just set QEMU_LD_PREFIX to your sysroot.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


RE: [EXTERNAL] Re: How to test aarch64 when building a cross-compiler?

2019-11-27 Thread Andrew Dean via gcc


> On 11/25/19 2:43 PM, Andrew Dean via gcc wrote:
> >> I get errors like this:
> >>
> >> aarch64-glibc-linux-gnu-gcc: fatal error: cannot read spec file
> >> 'rdimon.specs': No such file or directory
> >>
> >> I can see that the rdimon.specs flag is added based on this line
> >> in aarch64-
> > sim.exp:
> >
> > Where does aarch64-sim.exp comes from?
> 
>  /usr/share/dejagnu/baseboards/aarch64-sim.exp
> 
> >
> >>
> >> set_board_info ldflags  "[libgloss_link_flags]
> >> [newlib_link_flags]
> >> -
> > specs=rdimon.specs"
> >>
> > I think this is for baremetal/newlib targets, ie. aarch64-elf, not
> > for aarch64- linux-gnu.
> 
> >>
> >> Yes -specs=rdimon.specs and other such flags are for use only on
> >> bare-metal targets.
> >>
>  Hmm.. build-many-glibcs.py doesn't like either aarch64-elf or
>  aarch64-linux-
> >> elf...
>  I get a KeyError in build_compilers and build_glibcs when it tries
>  to look up
> >> the config with either of those values.
> 
> >>>
> >>> Unfortunately the build-many-glibcs.py does not have support for
> >>> baremetal build yet (since it is a tool created to build
> >>> cross-compiling toolchain using glibc).
> >>
> >> And glibc doesn't work bare-metal ..
> >>
> >> regards
> >> Ramana
> > I guess that means that the dejagnu baseboard "aarch64-sim" is only meant
> to do bare-metal testing? How would one build/test GCC hosted on x86_64 and
> targeting aarch64 then? Is there a different simulator approach I should be
> using?
> I've used qemu for this kind of testing.  In my environment I have root
> filesystems with native binaries/libraries.  I can just chroot into those
> filesystems and qemu handles everything.
> 
> In theory one wouldn't even need to chroot into the filesystems if you set the
> library paths right.
> 
> jeff

Thanks, Jeff. qemu did the trick. Specifically, I did the following:

1. sudo apt-get install qemu-user-static
2. export 
LD_LIBRARY_PATH=${BuildRoot}/install/glibcs/aarch64-linux-gnu/lib64:${BuildRoot}/install/compilers/aarch64-linux-gnu/aarch64-glibc-linux-gnu/lib64
 
3. sudo ln -s 
${BuildRoot}/install/glibcs/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1 
/lib/ld-linux-aarch64.so.1
4. Run the gcc tests as previously described
5. Remove the symlink
6. Restore the previous value of LD_LIBRARY_PATH

There are still a few test failures that we will need to investigate, but this 
was a huge leap forward.


Re: [EXTERNAL] Re: How to test aarch64 when building a cross-compiler?

2019-11-26 Thread Jeff Law
On 11/25/19 2:43 PM, Andrew Dean via gcc wrote:
>> I get errors like this:
>>
>> aarch64-glibc-linux-gnu-gcc: fatal error: cannot read spec file
>> 'rdimon.specs': No such file or directory
>>
>> I can see that the rdimon.specs flag is added based on this line
>> in aarch64-
> sim.exp:
>
> Where does aarch64-sim.exp comes from?

 /usr/share/dejagnu/baseboards/aarch64-sim.exp

>
>>
>> set_board_info ldflags  "[libgloss_link_flags] [newlib_link_flags]
>> -
> specs=rdimon.specs"
>>
> I think this is for baremetal/newlib targets, ie. aarch64-elf, not
> for aarch64- linux-gnu.

>>
>> Yes -specs=rdimon.specs and other such flags are for use only on bare-metal
>> targets.
>>
 Hmm.. build-many-glibcs.py doesn't like either aarch64-elf or 
 aarch64-linux-
>> elf...
 I get a KeyError in build_compilers and build_glibcs when it tries to look 
 up
>> the config with either of those values.

>>>
>>> Unfortunately the build-many-glibcs.py does not have support for
>>> baremetal build yet (since it is a tool created to build
>>> cross-compiling toolchain using glibc).
>>
>> And glibc doesn't work bare-metal ..
>>
>> regards
>> Ramana
> I guess that means that the dejagnu baseboard "aarch64-sim" is only meant to 
> do bare-metal testing? How would one build/test GCC hosted on x86_64 and 
> targeting aarch64 then? Is there a different simulator approach I should be 
> using?
I've used qemu for this kind of testing.  In my environment I have root
filesystems with native binaries/libraries.  I can just chroot into
those filesystems and qemu handles everything.

In theory one wouldn't even need to chroot into the filesystems if you
set the library paths right.

jeff



Re: [EXTERNAL] Re: How to test aarch64 when building a cross-compiler?

2019-11-25 Thread Ramana Radhakrishnan
On Mon, Nov 25, 2019 at 9:43 PM Andrew Dean  wrote:
>
> > > >>> I get errors like this:
> > > >>>
> > > >>> aarch64-glibc-linux-gnu-gcc: fatal error: cannot read spec file
> > > >>> 'rdimon.specs': No such file or directory
> > > >>>
> > > >>> I can see that the rdimon.specs flag is added based on this line
> > > >>> in aarch64-
> > > >> sim.exp:
> > > >>
> > > >> Where does aarch64-sim.exp comes from?
> > > >
> > > > /usr/share/dejagnu/baseboards/aarch64-sim.exp
> > > >
> > > >>
> > > >>>
> > > >>> set_board_info ldflags  "[libgloss_link_flags] [newlib_link_flags]
> > > >>> -
> > > >> specs=rdimon.specs"
> > > >>>
> > > >> I think this is for baremetal/newlib targets, ie. aarch64-elf, not
> > > >> for aarch64- linux-gnu.
> > > >
> >
> > Yes -specs=rdimon.specs and other such flags are for use only on bare-metal
> > targets.
> >
> > > > Hmm.. build-many-glibcs.py doesn't like either aarch64-elf or 
> > > > aarch64-linux-
> > elf...
> > > > I get a KeyError in build_compilers and build_glibcs when it tries to 
> > > > look up
> > the config with either of those values.
> > > >
> > >
> > > Unfortunately the build-many-glibcs.py does not have support for
> > > baremetal build yet (since it is a tool created to build
> > > cross-compiling toolchain using glibc).
> >
> > And glibc doesn't work bare-metal ..
> >
> > regards
> > Ramana
> I guess that means that the dejagnu baseboard "aarch64-sim" is only meant to 
> do bare-metal testing? How would one build/test GCC hosted on x86_64 and 
> targeting aarch64 then? Is there a different simulator approach I should be 
> using?

For cross-compilers with Linux, you've got 2 options - write up a
board file to use qemu in user-emulation mode or indeed system
emulation mode or use real hardware and construct something using ssh
/ scp.

R


RE: [EXTERNAL] Re: How to test aarch64 when building a cross-compiler?

2019-11-25 Thread Andrew Dean via gcc
> > >>> I get errors like this:
> > >>>
> > >>> aarch64-glibc-linux-gnu-gcc: fatal error: cannot read spec file
> > >>> 'rdimon.specs': No such file or directory
> > >>>
> > >>> I can see that the rdimon.specs flag is added based on this line
> > >>> in aarch64-
> > >> sim.exp:
> > >>
> > >> Where does aarch64-sim.exp comes from?
> > >
> > > /usr/share/dejagnu/baseboards/aarch64-sim.exp
> > >
> > >>
> > >>>
> > >>> set_board_info ldflags  "[libgloss_link_flags] [newlib_link_flags]
> > >>> -
> > >> specs=rdimon.specs"
> > >>>
> > >> I think this is for baremetal/newlib targets, ie. aarch64-elf, not
> > >> for aarch64- linux-gnu.
> > >
> 
> Yes -specs=rdimon.specs and other such flags are for use only on bare-metal
> targets.
> 
> > > Hmm.. build-many-glibcs.py doesn't like either aarch64-elf or 
> > > aarch64-linux-
> elf...
> > > I get a KeyError in build_compilers and build_glibcs when it tries to 
> > > look up
> the config with either of those values.
> > >
> >
> > Unfortunately the build-many-glibcs.py does not have support for
> > baremetal build yet (since it is a tool created to build
> > cross-compiling toolchain using glibc).
> 
> And glibc doesn't work bare-metal ..
> 
> regards
> Ramana
I guess that means that the dejagnu baseboard "aarch64-sim" is only meant to do 
bare-metal testing? How would one build/test GCC hosted on x86_64 and targeting 
aarch64 then? Is there a different simulator approach I should be using?


Re: [EXTERNAL] Re: How to test aarch64 when building a cross-compiler?

2019-11-25 Thread Ramana Radhakrishnan
On Mon, Nov 25, 2019 at 8:40 PM Adhemerval Zanella
 wrote:
>
>
>
> On 25/11/2019 17:28, Andrew Dean via gcc wrote:
> >>> This completes successfully. However, when I then try to run the gcc 
> >>> tests like
> >> so:
> >>> runtest --outdir . --tool gcc --srcdir /path/to/gcc/gcc/testsuite
> >>> aarch64.exp --target aarch64-linux-gnu --target_board aarch64-sim
> >>> --tool_exec
> >>> /path_to/build_dir/install/compilers/aarch64-linux-gnu/bin/aarch64-gli
> >>> bc-linux-gnu-gcc --verbose -v
> >>>
> >>> I get errors like this:
> >>>
> >>> aarch64-glibc-linux-gnu-gcc: fatal error: cannot read spec file
> >>> 'rdimon.specs': No such file or directory
> >>>
> >>> I can see that the rdimon.specs flag is added based on this line in 
> >>> aarch64-
> >> sim.exp:
> >>
> >> Where does aarch64-sim.exp comes from?
> >
> > /usr/share/dejagnu/baseboards/aarch64-sim.exp
> >
> >>
> >>>
> >>> set_board_info ldflags  "[libgloss_link_flags] [newlib_link_flags] -
> >> specs=rdimon.specs"
> >>>
> >> I think this is for baremetal/newlib targets, ie. aarch64-elf, not for 
> >> aarch64-
> >> linux-gnu.
> >

Yes -specs=rdimon.specs and other such flags are for use only on
bare-metal targets.

> > Hmm.. build-many-glibcs.py doesn't like either aarch64-elf or 
> > aarch64-linux-elf...
> > I get a KeyError in build_compilers and build_glibcs when it tries to look 
> > up the config with either of those values.
> >
>
> Unfortunately the build-many-glibcs.py does not have support for baremetal
> build yet (since it is a tool created to build cross-compiling toolchain
> using glibc).

And glibc doesn't work bare-metal ..

regards
Ramana


Re: [EXTERNAL] Re: How to test aarch64 when building a cross-compiler?

2019-11-25 Thread Adhemerval Zanella



On 25/11/2019 17:28, Andrew Dean via gcc wrote:
>>> This completes successfully. However, when I then try to run the gcc tests 
>>> like
>> so:
>>> runtest --outdir . --tool gcc --srcdir /path/to/gcc/gcc/testsuite
>>> aarch64.exp --target aarch64-linux-gnu --target_board aarch64-sim
>>> --tool_exec
>>> /path_to/build_dir/install/compilers/aarch64-linux-gnu/bin/aarch64-gli
>>> bc-linux-gnu-gcc --verbose -v
>>>
>>> I get errors like this:
>>>
>>> aarch64-glibc-linux-gnu-gcc: fatal error: cannot read spec file
>>> 'rdimon.specs': No such file or directory
>>>
>>> I can see that the rdimon.specs flag is added based on this line in aarch64-
>> sim.exp:
>>
>> Where does aarch64-sim.exp comes from?
> 
> /usr/share/dejagnu/baseboards/aarch64-sim.exp
> 
>>
>>>
>>> set_board_info ldflags  "[libgloss_link_flags] [newlib_link_flags] -
>> specs=rdimon.specs"
>>>
>> I think this is for baremetal/newlib targets, ie. aarch64-elf, not for 
>> aarch64-
>> linux-gnu.
> 
> Hmm.. build-many-glibcs.py doesn't like either aarch64-elf or 
> aarch64-linux-elf...
> I get a KeyError in build_compilers and build_glibcs when it tries to look up 
> the config with either of those values.
> 

Unfortunately the build-many-glibcs.py does not have support for baremetal
build yet (since it is a tool created to build cross-compiling toolchain
using glibc).


RE: [EXTERNAL] Re: How to test aarch64 when building a cross-compiler?

2019-11-25 Thread Andrew Dean via gcc
> > This completes successfully. However, when I then try to run the gcc tests 
> > like
> so:
> > runtest --outdir . --tool gcc --srcdir /path/to/gcc/gcc/testsuite
> > aarch64.exp --target aarch64-linux-gnu --target_board aarch64-sim
> > --tool_exec
> > /path_to/build_dir/install/compilers/aarch64-linux-gnu/bin/aarch64-gli
> > bc-linux-gnu-gcc --verbose -v
> >
> > I get errors like this:
> >
> > aarch64-glibc-linux-gnu-gcc: fatal error: cannot read spec file
> > 'rdimon.specs': No such file or directory
> >
> > I can see that the rdimon.specs flag is added based on this line in aarch64-
> sim.exp:
> 
> Where does aarch64-sim.exp comes from?

/usr/share/dejagnu/baseboards/aarch64-sim.exp

> 
> >
> > set_board_info ldflags  "[libgloss_link_flags] [newlib_link_flags] -
> specs=rdimon.specs"
> >
> I think this is for baremetal/newlib targets, ie. aarch64-elf, not for 
> aarch64-
> linux-gnu.

Hmm.. build-many-glibcs.py doesn't like either aarch64-elf or 
aarch64-linux-elf...
I get a KeyError in build_compilers and build_glibcs when it tries to look up 
the config with either of those values.