diff mbox

[1/2] package/Makefile.in: Fix dependency for selecting uclinux as TARGET_OS

Message ID 1378262598.32360.5.camel@phoenix
State Superseded
Headers show

Commit Message

Axel Lin Sept. 4, 2013, 2:43 a.m. UTC
Current setting only allows blackfin to select uclinux as TARGET_OS.
However, some noMMU ARM platforms that using FLAT binary format also need to
select uclinux as TARGET_OS. Fix the dependency.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
I need this change to allow testing build for ARM noMMU.
Maybe worth to upstream.

Axel
 package/Makefile.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Thomas Petazzoni Sept. 5, 2013, 9:44 p.m. UTC | #1
Dear Axel Lin,

On Wed, 04 Sep 2013 10:43:18 +0800, Axel Lin wrote:
> Current setting only allows blackfin to select uclinux as TARGET_OS.
> However, some noMMU ARM platforms that using FLAT binary format also need to
> select uclinux as TARGET_OS. Fix the dependency.

Are you sure uclinux as TARGET_OS is the right selection for ARM? The
release notes of gcc 4.7, at http://gcc.gnu.org/gcc-4.7/changes.html,
indicate:

""
The obsolete ports with alternatives are:

    arm*-*-rtems (use arm*-*-rtemseabi)
    arm*-*-linux-gnu (use arm*-*-linux-gnueabi)
    arm*-*-elf (use arm*-*-eabi)
    arm*-*-uclinux* (use arm*-*-uclinux*eabi)
""

So it looks like the arm-<something>-uclinux* tuple should not be used,
if I understand this correctly. Do you have more details about why
arm-<something>-uclinux* should be used?

Thanks!

Thomas
Axel Lin Sept. 6, 2013, 2:21 a.m. UTC | #2
2013/9/6 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
> Dear Axel Lin,
>
> On Wed, 04 Sep 2013 10:43:18 +0800, Axel Lin wrote:
>> Current setting only allows blackfin to select uclinux as TARGET_OS.
>> However, some noMMU ARM platforms that using FLAT binary format also need to
>> select uclinux as TARGET_OS. Fix the dependency.
>
> Are you sure uclinux as TARGET_OS is the right selection for ARM? The
> release notes of gcc 4.7, at http://gcc.gnu.org/gcc-4.7/changes.html,
> indicate:
>
> ""
> The obsolete ports with alternatives are:
>
>     arm*-*-rtems (use arm*-*-rtemseabi)
>     arm*-*-linux-gnu (use arm*-*-linux-gnueabi)
>     arm*-*-elf (use arm*-*-eabi)
>     arm*-*-uclinux* (use arm*-*-uclinux*eabi)
> ""
>
> So it looks like the arm-<something>-uclinux* tuple should not be used,
> if I understand this correctly. Do you have more details about why
> arm-<something>-uclinux* should be used?

Somehow, I thought noMMU ARM platforms that using FLAT binary format needs to
select uclinux as TARGET_OS.
But since you mentioned the release notes of gcc 4.7, I'm not 100% sure.

I check my build, the result is I have arm-buildroot-uclinux-uclibcgnueabi-gcc.
And the build log shows it checks target system type as:
checking target system type... arm-buildroot-uclinux-uclibcgnueabi

Does buildroot automatically convert arm*-*-uclinux* to arm*-*-uclinux*eabi?

I also check host-gcc-final-4.5.4/gcc/config.gcc and libgcc/config.host.
Looks like it also expects arm*-*-uclinux* for ARM ucLinux and arm*-*-linux* for
ARM GNU/Linux with ELF.

Thanks for the review,
Axel
Thomas Petazzoni Sept. 6, 2013, 6:26 a.m. UTC | #3
Dear Axel Lin,

On Fri, 6 Sep 2013 10:21:55 +0800, Axel Lin wrote:

> > So it looks like the arm-<something>-uclinux* tuple should not be used,
> > if I understand this correctly. Do you have more details about why
> > arm-<something>-uclinux* should be used?
> 
> Somehow, I thought noMMU ARM platforms that using FLAT binary format needs to
> select uclinux as TARGET_OS.
> But since you mentioned the release notes of gcc 4.7, I'm not 100% sure.

I am not sure either.

> I check my build, the result is I have arm-buildroot-uclinux-uclibcgnueabi-gcc.
> And the build log shows it checks target system type as:
> checking target system type... arm-buildroot-uclinux-uclibcgnueabi
> 
> Does buildroot automatically convert arm*-*-uclinux* to arm*-*-uclinux*eabi?
> 
> I also check host-gcc-final-4.5.4/gcc/config.gcc and libgcc/config.host.
> Looks like it also expects arm*-*-uclinux* for ARM ucLinux and arm*-*-linux* for
> ARM GNU/Linux with ELF.

Can you check in more recent gcc versions such as 4.7 or 4.8 ? Looking
at the most recent versions is important to see what is the current
tuple accepted for this situation.

Thanks,

Thomas
Axel Lin Sept. 6, 2013, 7:14 a.m. UTC | #4
2013/9/6 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
> Dear Axel Lin,
>
> On Fri, 6 Sep 2013 10:21:55 +0800, Axel Lin wrote:
>
>> > So it looks like the arm-<something>-uclinux* tuple should not be used,
>> > if I understand this correctly. Do you have more details about why
>> > arm-<something>-uclinux* should be used?
>>
>> Somehow, I thought noMMU ARM platforms that using FLAT binary format needs to
>> select uclinux as TARGET_OS.
>> But since you mentioned the release notes of gcc 4.7, I'm not 100% sure.
>
> I am not sure either.
>
>> I check my build, the result is I have arm-buildroot-uclinux-uclibcgnueabi-gcc.
>> And the build log shows it checks target system type as:
>> checking target system type... arm-buildroot-uclinux-uclibcgnueabi
>>
>> Does buildroot automatically convert arm*-*-uclinux* to arm*-*-uclinux*eabi?
>>
>> I also check host-gcc-final-4.5.4/gcc/config.gcc and libgcc/config.host.
>> Looks like it also expects arm*-*-uclinux* for ARM ucLinux and arm*-*-linux* for
>> ARM GNU/Linux with ELF.
>
> Can you check in more recent gcc versions such as 4.7 or 4.8 ? Looking
> at the most recent versions is important to see what is the current
> tuple accepted for this situation.

Hi Thomas,
In host-gcc-final-4.8.1/gcc/config.gcc:

# Unsupported targets list.  Do not put an entry in this list unless
# it would otherwise be caught by a more permissive pattern.  The list
# should be in alphabetical order.
case ${target} in
 # Avoid special cases that are not obsolete
   arm*-*-*eabi*                        \
 )
        ;;
   arm*-wince-pe*                       \
 | arm*-*-ecos-elf                      \
 | arm*-*-elf                           \
 | arm*-*-freebsd*                      \
 | arm*-*-linux*                        \
 | arm*-*-uclinux*                      \
 | i[34567]86-go32-*                    \
 | i[34567]86-*-go32*                   \
 | m68k-*-uclinuxoldabi*                \
 | mips64orion*-*-rtems*                \
 | pdp11-*-bsd                          \
 | sparc-hal-solaris2*                  \
 | thumb-*-*                            \
 | *-*-freebsd[12] | *-*-freebsd[12].*  \
 | *-*-freebsd*aout*                    \
 | *-*-linux*aout*                      \
 | *-*-linux*coff*                      \
 | *-*-linux*libc1*                     \
 | *-*-linux*oldld*                     \
 | *-*-rtemsaout*                       \
 | *-*-rtemscoff*                       \
 | *-*-solaris2                         \
 | *-*-solaris2.[0-8]                   \
 | *-*-solaris2.[0-8].*                 \
 | *-*-sysv*                            \
 | vax-*-vms*                           \
 )
        echo "*** Configuration ${target} not supported" 1>&2
        exit 1
        ;;
esac

The first case shows
case ${target} in
 # Avoid special cases that are not obsolete
   arm*-*-*eabi*                        \
 )
        ;;

Although I have no idea which part of buildroot system converts
arm*-*-uclinux* to arm*-*-uclinux*eabi.
The build result shows arm-buildroot-uclinux-uclibcgnueabi which matches
the first case.
So I think it's ok to set TARGET_OS=uclinux.

Regards,
Axel
diff mbox

Patch

diff --git a/package/Makefile.in b/package/Makefile.in
index 91ae1b9..6aa6266 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -23,8 +23,8 @@  MAKE:=$(HOSTMAKE) -j$(PARALLEL_JOBS)
 # Compute GNU_TARGET_NAME
 GNU_TARGET_NAME=$(ARCH)-buildroot-$(TARGET_OS)-$(LIBC)$(ABI)
 
-# Blackfin FLAT needs uclinux
-ifeq ($(BR2_bfin)$(BR2_BINFMT_FLAT),yy)
+# FLAT binary format needs uclinux
+ifeq ($(BR2_BINFMT_FLAT),y)
 TARGET_OS=uclinux
 else
 TARGET_OS=linux