[ARM/FDPIC,v5,02/21,ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts

Message ID 20190515124006.25840-3-christophe.lyon@st.com
State New
Headers show
Series
  • FDPIC ABI for ARM
Related show

Commit Message

Christophe Lyon May 15, 2019, 12:39 p.m.
The new arm-uclinuxfdpiceabi target behaves pretty much like
arm-linux-gnueabi. In order the enable the same set of features, we
have to update several configure scripts that generally match targets
like *-*-linux*: in most places, we add *-uclinux* where there is
already *-linux*, or uclinux* when there is already linux*.

In gcc/config.gcc and libgcc/config.host we use *-*-uclinuxfdpiceabi
because there is already a different behaviour for *-*uclinux* target.

In libtool.m4, we use uclinuxfdpiceabi in cases where ELF shared
libraries support is required, as uclinux does not guarantee that.

2019-XX-XX  Christophe Lyon  <christophe.lyon@st.com>

	config/
	* futex.m4: Handle *-uclinux*.
	* tls.m4 (GCC_CHECK_TLS): Likewise.

	gcc/
	* config.gcc: Handle *-*-uclinuxfdpiceabi.

	libatomic/
	* configure.tgt: Handle arm*-*-uclinux*.
	* configure: Regenerate.

	libgcc/
	* config.host: Handle *-*-uclinuxfdpiceabi.

	libitm/
	* configure.tgt: Handle *-*-uclinux*.
	* configure: Regenerate.

	libstdc++-v3/
	* acinclude.m4: Handle uclinux*.
	* configure: Regenerate.
	* configure.host: Handle uclinux*

	* libtool.m4: Handle uclinux*.

Change-Id: I6a1fdcd9847d8a82179a214612a3474c1f492916

-- 
2.6.3

Comments

Richard Sandiford July 12, 2019, 6:49 a.m. | #1
Christophe Lyon <christophe.lyon@st.com> writes:
> The new arm-uclinuxfdpiceabi target behaves pretty much like

> arm-linux-gnueabi. In order the enable the same set of features, we

> have to update several configure scripts that generally match targets

> like *-*-linux*: in most places, we add *-uclinux* where there is

> already *-linux*, or uclinux* when there is already linux*.

>

> In gcc/config.gcc and libgcc/config.host we use *-*-uclinuxfdpiceabi

> because there is already a different behaviour for *-*uclinux* target.

>

> In libtool.m4, we use uclinuxfdpiceabi in cases where ELF shared

> libraries support is required, as uclinux does not guarantee that.

>

> 2019-XX-XX  Christophe Lyon  <christophe.lyon@st.com>

>

> 	config/

> 	* futex.m4: Handle *-uclinux*.

> 	* tls.m4 (GCC_CHECK_TLS): Likewise.

>

> 	gcc/

> 	* config.gcc: Handle *-*-uclinuxfdpiceabi.

>

> 	libatomic/

> 	* configure.tgt: Handle arm*-*-uclinux*.

> 	* configure: Regenerate.

>

> 	libgcc/

> 	* config.host: Handle *-*-uclinuxfdpiceabi.

>

> 	libitm/

> 	* configure.tgt: Handle *-*-uclinux*.

> 	* configure: Regenerate.

>

> 	libstdc++-v3/

> 	* acinclude.m4: Handle uclinux*.

> 	* configure: Regenerate.

> 	* configure.host: Handle uclinux*

>

> 	* libtool.m4: Handle uclinux*.


Has the libtool.m4 patch been submitted to upstream libtool?
I think this is supposed to be handled by submitting there first
and then cherry-picking into gcc, so that the change isn't lost
by a future import.

> [...]

>

> diff --git a/config/tls.m4 b/config/tls.m4

> index 1a5fc59..a487aa4 100644

> --- a/config/tls.m4

> +++ b/config/tls.m4

> @@ -76,7 +76,7 @@ AC_DEFUN([GCC_CHECK_TLS], [

>  	  dnl Shared library options may depend on the host; this check

>  	  dnl is only known to be needed for GNU/Linux.

>  	  case $host in

> -	    *-*-linux*)

> +	    *-*-linux* | -*-uclinux*)

>  	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"

>  	      ;;

>  	  esac


Is this right for all uclinux targets?  

> diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4

> index 84258d8..cb0fdc5 100644

> --- a/libstdc++-v3/acinclude.m4

> +++ b/libstdc++-v3/acinclude.m4


It'd probably be worth splitting out the libstdc++-v3 bits and
submitting them separately, cc:ing libstdc++@gcc.gnu.org.  But...

> @@ -1404,7 +1404,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [

>          ac_has_nanosleep=yes

>          ac_has_sched_yield=yes

>          ;;

> -      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)

> +      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)

>          AC_MSG_CHECKING([for at least GNU libc 2.17])

>          AC_TRY_COMPILE(

>            [#include <features.h>],


is this the right thing to do?  It seems odd to be testing the glibc
version for uclibc.

Do you want to support multiple possible settings of
ac_has_clock_monotonic and ac_has_clock_realtime?  Or could you just
hard-code the values, given particular baseline assumptions about the
version of uclibc etc.?  Hard-coding would then make....

> @@ -1526,7 +1526,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [

>  

>    if test x"$ac_has_clock_monotonic" != x"yes"; then

>      case ${target_os} in

> -      linux*)

> +      linux* | uclinux*)

>  	AC_MSG_CHECKING([for clock_gettime syscall])

>  	AC_TRY_COMPILE(

>  	  [#include <unistd.h>


...this redundant.

> @@ -2415,7 +2415,7 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [

>    # Default to "generic".

>    if test $enable_clocale_flag = auto; then

>      case ${target_os} in

> -      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)

> +      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)

>  	enable_clocale_flag=gnu

>  	;;

>        darwin*)


This too seems to be choosing a glibc setting for a uclibc target.

> @@ -2661,7 +2661,7 @@ AC_DEFUN([GLIBCXX_ENABLE_ALLOCATOR], [

>    # Default to "new".

>    if test $enable_libstdcxx_allocator_flag = auto; then

>      case ${target_os} in

> -      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)

> +      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)

>  	enable_libstdcxx_allocator_flag=new

>  	;;

>        *)


The full case is:

  # Probe for host-specific support if no specific model is specified.
  # Default to "new".
  if test $enable_libstdcxx_allocator_flag = auto; then
    case ${target_os} in
      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
	enable_libstdcxx_allocator_flag=new
	;;
      *)
	enable_libstdcxx_allocator_flag=new
	;;
    esac
  fi

which looks a bit redundant :-)

Thanks,
Richard
Christophe Lyon July 12, 2019, 1 p.m. | #2
On Fri, 12 Jul 2019 at 08:49, Richard Sandiford
<richard.sandiford@arm.com> wrote:
>

> Christophe Lyon <christophe.lyon@st.com> writes:

> > The new arm-uclinuxfdpiceabi target behaves pretty much like

> > arm-linux-gnueabi. In order the enable the same set of features, we

> > have to update several configure scripts that generally match targets

> > like *-*-linux*: in most places, we add *-uclinux* where there is

> > already *-linux*, or uclinux* when there is already linux*.

> >

> > In gcc/config.gcc and libgcc/config.host we use *-*-uclinuxfdpiceabi

> > because there is already a different behaviour for *-*uclinux* target.

> >

> > In libtool.m4, we use uclinuxfdpiceabi in cases where ELF shared

> > libraries support is required, as uclinux does not guarantee that.

> >

> > 2019-XX-XX  Christophe Lyon  <christophe.lyon@st.com>

> >

> >       config/

> >       * futex.m4: Handle *-uclinux*.

> >       * tls.m4 (GCC_CHECK_TLS): Likewise.

> >

> >       gcc/

> >       * config.gcc: Handle *-*-uclinuxfdpiceabi.

> >

> >       libatomic/

> >       * configure.tgt: Handle arm*-*-uclinux*.

> >       * configure: Regenerate.

> >

> >       libgcc/

> >       * config.host: Handle *-*-uclinuxfdpiceabi.

> >

> >       libitm/

> >       * configure.tgt: Handle *-*-uclinux*.

> >       * configure: Regenerate.

> >

> >       libstdc++-v3/

> >       * acinclude.m4: Handle uclinux*.

> >       * configure: Regenerate.

> >       * configure.host: Handle uclinux*

> >

> >       * libtool.m4: Handle uclinux*.

>

> Has the libtool.m4 patch been submitted to upstream libtool?

> I think this is supposed to be handled by submitting there first

> and then cherry-picking into gcc, so that the change isn't lost

> by a future import.


Yes, this was raised by Joseph when I first posted this patch series last year:
https://gcc.gnu.org/ml/gcc-patches/2018-05/msg01507.html
I sent a patch there:
https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html
but didn't get any feedback :-(


>

> > [...]

> >

> > diff --git a/config/tls.m4 b/config/tls.m4

> > index 1a5fc59..a487aa4 100644

> > --- a/config/tls.m4

> > +++ b/config/tls.m4

> > @@ -76,7 +76,7 @@ AC_DEFUN([GCC_CHECK_TLS], [

> >         dnl Shared library options may depend on the host; this check

> >         dnl is only known to be needed for GNU/Linux.

> >         case $host in

> > -         *-*-linux*)

> > +         *-*-linux* | -*-uclinux*)

> >             LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"

> >             ;;

> >         esac

>

> Is this right for all uclinux targets?


So...... Let me bring back a bit of history/context. When we developed
FDPIC support in ST several years ago, we used arm-linux-uclibceabi as
triplet.
But when I posted the binutils patch series, Joseph said it wasn't
appropriate and suggested arm-*-uclinuxfdpiceabi instead.
https://sourceware.org/ml/binutils/2018-03/msg00324.html

This had an impact on the GCC side, because some parts weren't enabled
anymore after the triplet change, so I had to introduce this
configure* patch to restore the missing features.

Then, I wondered about the impact on other uclinux targets, but it was
hard to find a supported-supposed-to-work one.
I asked for help on the gcc list
(https://gcc.gnu.org/ml/gcc/2018-10/msg00154.html), and finally
managed to build and test an xtensa toolchain.

And this has an impact on the results on xtensa, as I reported in V3
of this patch:
https://gcc.gnu.org/ml/gcc-patches/2018-11/msg00713.html

But given the little feedback, I'm wondering whether uclinux targets
are actually still alive/maintained?



>

> > diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4

> > index 84258d8..cb0fdc5 100644

> > --- a/libstdc++-v3/acinclude.m4

> > +++ b/libstdc++-v3/acinclude.m4

>

> It'd probably be worth splitting out the libstdc++-v3 bits and

> submitting them separately, cc:ing libstdc++@gcc.gnu.org.  But...

>

> > @@ -1404,7 +1404,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [

> >          ac_has_nanosleep=yes

> >          ac_has_sched_yield=yes

> >          ;;

> > -      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)

> > +      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)

> >          AC_MSG_CHECKING([for at least GNU libc 2.17])

> >          AC_TRY_COMPILE(

> >            [#include <features.h>],

>

> is this the right thing to do?  It seems odd to be testing the glibc

> version for uclibc.

As said above, I needed to set ac_has_nanosleep and ac_has_sched_yield so that
tests continue to pass after the triplet change. Looks like I got the
effect I wanted, but
not in the right way indeed.

> Do you want to support multiple possible settings of

> ac_has_clock_monotonic and ac_has_clock_realtime?  Or could you just

> hard-code the values, given particular baseline assumptions about the

> version of uclibc etc.?  Hard-coding would then make....

Right, I think it could be hardcoded.

>

> > @@ -1526,7 +1526,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [

> >

> >    if test x"$ac_has_clock_monotonic" != x"yes"; then

> >      case ${target_os} in

> > -      linux*)

> > +      linux* | uclinux*)

> >       AC_MSG_CHECKING([for clock_gettime syscall])

> >       AC_TRY_COMPILE(

> >         [#include <unistd.h>

>

> ...this redundant.

Indeed.

>

> > @@ -2415,7 +2415,7 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [

> >    # Default to "generic".

> >    if test $enable_clocale_flag = auto; then

> >      case ${target_os} in

> > -      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)

> > +      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)

> >       enable_clocale_flag=gnu

> >       ;;

> >        darwin*)

>

> This too seems to be choosing a glibc setting for a uclibc target.

Indeed, but I'd have to re-run the tests without this hunk to remember
which ones fail with enable_clocale_flag=generic.

>

> > @@ -2661,7 +2661,7 @@ AC_DEFUN([GLIBCXX_ENABLE_ALLOCATOR], [

> >    # Default to "new".

> >    if test $enable_libstdcxx_allocator_flag = auto; then

> >      case ${target_os} in

> > -      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)

> > +      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)

> >       enable_libstdcxx_allocator_flag=new

> >       ;;

> >        *)

>

> The full case is:

>

>   # Probe for host-specific support if no specific model is specified.

>   # Default to "new".

>   if test $enable_libstdcxx_allocator_flag = auto; then

>     case ${target_os} in

>       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)

>         enable_libstdcxx_allocator_flag=new

>         ;;

>       *)

>         enable_libstdcxx_allocator_flag=new

>         ;;

>     esac

>   fi

>

> which looks a bit redundant :-)

Good catch

Thanks a lot for your feedback.

Christophe

>

> Thanks,

> Richard
Richard Sandiford July 12, 2019, 1:25 p.m. | #3
Christophe Lyon <christophe.lyon@linaro.org> writes:
> On Fri, 12 Jul 2019 at 08:49, Richard Sandiford

> <richard.sandiford@arm.com> wrote:

>>

>> Christophe Lyon <christophe.lyon@st.com> writes:

>> > The new arm-uclinuxfdpiceabi target behaves pretty much like

>> > arm-linux-gnueabi. In order the enable the same set of features, we

>> > have to update several configure scripts that generally match targets

>> > like *-*-linux*: in most places, we add *-uclinux* where there is

>> > already *-linux*, or uclinux* when there is already linux*.

>> >

>> > In gcc/config.gcc and libgcc/config.host we use *-*-uclinuxfdpiceabi

>> > because there is already a different behaviour for *-*uclinux* target.

>> >

>> > In libtool.m4, we use uclinuxfdpiceabi in cases where ELF shared

>> > libraries support is required, as uclinux does not guarantee that.

>> >

>> > 2019-XX-XX  Christophe Lyon  <christophe.lyon@st.com>

>> >

>> >       config/

>> >       * futex.m4: Handle *-uclinux*.

>> >       * tls.m4 (GCC_CHECK_TLS): Likewise.

>> >

>> >       gcc/

>> >       * config.gcc: Handle *-*-uclinuxfdpiceabi.

>> >

>> >       libatomic/

>> >       * configure.tgt: Handle arm*-*-uclinux*.

>> >       * configure: Regenerate.

>> >

>> >       libgcc/

>> >       * config.host: Handle *-*-uclinuxfdpiceabi.

>> >

>> >       libitm/

>> >       * configure.tgt: Handle *-*-uclinux*.

>> >       * configure: Regenerate.

>> >

>> >       libstdc++-v3/

>> >       * acinclude.m4: Handle uclinux*.

>> >       * configure: Regenerate.

>> >       * configure.host: Handle uclinux*

>> >

>> >       * libtool.m4: Handle uclinux*.

>>

>> Has the libtool.m4 patch been submitted to upstream libtool?

>> I think this is supposed to be handled by submitting there first

>> and then cherry-picking into gcc, so that the change isn't lost

>> by a future import.

>

> Yes, this was raised by Joseph when I first posted this patch series last year:

> https://gcc.gnu.org/ml/gcc-patches/2018-05/msg01507.html

> I sent a patch there:

> https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html

> but didn't get any feedback :-(


Ah, OK.  In that case, it might be worth adding a comment to libtool.m4
that this has been submitted to libtool but not (yet?) accepted, so at
the moment it's a GCC-local change.  That might help the next person
applying libtool patches to understand the history.

>> > diff --git a/config/tls.m4 b/config/tls.m4

>> > index 1a5fc59..a487aa4 100644

>> > --- a/config/tls.m4

>> > +++ b/config/tls.m4

>> > @@ -76,7 +76,7 @@ AC_DEFUN([GCC_CHECK_TLS], [

>> >         dnl Shared library options may depend on the host; this check

>> >         dnl is only known to be needed for GNU/Linux.

>> >         case $host in

>> > -         *-*-linux*)

>> > +         *-*-linux* | -*-uclinux*)

>> >             LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"

>> >             ;;

>> >         esac

>>

>> Is this right for all uclinux targets?

>

> So...... Let me bring back a bit of history/context. When we developed

> FDPIC support in ST several years ago, we used arm-linux-uclibceabi as

> triplet.

> But when I posted the binutils patch series, Joseph said it wasn't

> appropriate and suggested arm-*-uclinuxfdpiceabi instead.

> https://sourceware.org/ml/binutils/2018-03/msg00324.html

>

> This had an impact on the GCC side, because some parts weren't enabled

> anymore after the triplet change, so I had to introduce this

> configure* patch to restore the missing features.

>

> Then, I wondered about the impact on other uclinux targets, but it was

> hard to find a supported-supposed-to-work one.

> I asked for help on the gcc list

> (https://gcc.gnu.org/ml/gcc/2018-10/msg00154.html), and finally

> managed to build and test an xtensa toolchain.

>

> And this has an impact on the results on xtensa, as I reported in V3

> of this patch:

> https://gcc.gnu.org/ml/gcc-patches/2018-11/msg00713.html

>

> But given the little feedback, I'm wondering whether uclinux targets

> are actually still alive/maintained?


Well, maybe not maintained :-)

But while supporting -shared is AIUI the main goal of FDPIC, I'd be
surprised if it was the right thing to test for all uclinux targets.
Testing *-*-uclinuxfdpic* would be more obvious IMO.  (But there again,
I'm not an expert on this stuff.)

Thanks,
Richard
Christophe Lyon Aug. 29, 2019, 2:54 p.m. | #4
On 12/07/2019 08:49, Richard Sandiford wrote:
> Christophe Lyon <christophe.lyon@st.com> writes:

>> The new arm-uclinuxfdpiceabi target behaves pretty much like

>> arm-linux-gnueabi. In order the enable the same set of features, we

>> have to update several configure scripts that generally match targets

>> like *-*-linux*: in most places, we add *-uclinux* where there is

>> already *-linux*, or uclinux* when there is already linux*.

>>

>> In gcc/config.gcc and libgcc/config.host we use *-*-uclinuxfdpiceabi

>> because there is already a different behaviour for *-*uclinux* target.

>>

>> In libtool.m4, we use uclinuxfdpiceabi in cases where ELF shared

>> libraries support is required, as uclinux does not guarantee that.

>>

>> 2019-XX-XX  Christophe Lyon  <christophe.lyon@st.com>

>>

>> 	config/

>> 	* futex.m4: Handle *-uclinux*.

>> 	* tls.m4 (GCC_CHECK_TLS): Likewise.

>>

>> 	gcc/

>> 	* config.gcc: Handle *-*-uclinuxfdpiceabi.

>>

>> 	libatomic/

>> 	* configure.tgt: Handle arm*-*-uclinux*.

>> 	* configure: Regenerate.

>>

>> 	libgcc/

>> 	* config.host: Handle *-*-uclinuxfdpiceabi.

>>

>> 	libitm/

>> 	* configure.tgt: Handle *-*-uclinux*.

>> 	* configure: Regenerate.

>>

>> 	libstdc++-v3/

>> 	* acinclude.m4: Handle uclinux*.

>> 	* configure: Regenerate.

>> 	* configure.host: Handle uclinux*

>>

>> 	* libtool.m4: Handle uclinux*.

> 

> Has the libtool.m4 patch been submitted to upstream libtool?

> I think this is supposed to be handled by submitting there first

> and then cherry-picking into gcc, so that the change isn't lost

> by a future import.

> 

I added a comment to libtool.m4 about this.

>> [...]

>>

>> diff --git a/config/tls.m4 b/config/tls.m4

>> index 1a5fc59..a487aa4 100644

>> --- a/config/tls.m4

>> +++ b/config/tls.m4

>> @@ -76,7 +76,7 @@ AC_DEFUN([GCC_CHECK_TLS], [

>>   	  dnl Shared library options may depend on the host; this check

>>   	  dnl is only known to be needed for GNU/Linux.

>>   	  case $host in

>> -	    *-*-linux*)

>> +	    *-*-linux* | -*-uclinux*)

>>   	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"

>>   	      ;;

>>   	  esac

> 

> Is this right for all uclinux targets?

I don't think so, now restricted to -*-uclinuxfdpic*

> 

>> diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4

>> index 84258d8..cb0fdc5 100644

>> --- a/libstdc++-v3/acinclude.m4

>> +++ b/libstdc++-v3/acinclude.m4

> 

> It'd probably be worth splitting out the libstdc++-v3 bits and

> submitting them separately, cc:ing libstdc++@gcc.gnu.org.  But...


I've now split the patch into two parts (both attached here)
> 

>> @@ -1404,7 +1404,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [

>>           ac_has_nanosleep=yes

>>           ac_has_sched_yield=yes

>>           ;;

>> -      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)

>> +      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)

>>           AC_MSG_CHECKING([for at least GNU libc 2.17])

>>           AC_TRY_COMPILE(

>>             [#include <features.h>],

> 

> is this the right thing to do?  It seems odd to be testing the glibc

> version for uclibc.

> 

> Do you want to support multiple possible settings of

> ac_has_clock_monotonic and ac_has_clock_realtime?  Or could you just

> hard-code the values, given particular baseline assumptions about the

> version of uclibc etc.?  Hard-coding would then make....

> 

>> @@ -1526,7 +1526,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [

>>   

>>     if test x"$ac_has_clock_monotonic" != x"yes"; then

>>       case ${target_os} in

>> -      linux*)

>> +      linux* | uclinux*)

>>   	AC_MSG_CHECKING([for clock_gettime syscall])

>>   	AC_TRY_COMPILE(

>>   	  [#include <unistd.h>

> 

> ...this redundant.

> 

Right, now fixed.

>> @@ -2415,7 +2415,7 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [

>>     # Default to "generic".

>>     if test $enable_clocale_flag = auto; then

>>       case ${target_os} in

>> -      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)

>> +      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)

>>   	enable_clocale_flag=gnu

>>   	;;

>>         darwin*)

> 

> This too seems to be choosing a glibc setting for a uclibc target.

Indeed.

> 

>> @@ -2661,7 +2661,7 @@ AC_DEFUN([GLIBCXX_ENABLE_ALLOCATOR], [

>>     # Default to "new".

>>     if test $enable_libstdcxx_allocator_flag = auto; then

>>       case ${target_os} in

>> -      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)

>> +      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)

>>   	enable_libstdcxx_allocator_flag=new

>>   	;;

>>         *)

> 

> The full case is:

> 

>    # Probe for host-specific support if no specific model is specified.

>    # Default to "new".

>    if test $enable_libstdcxx_allocator_flag = auto; then

>      case ${target_os} in

>        linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)

> 	enable_libstdcxx_allocator_flag=new

> 	;;

>        *)

> 	enable_libstdcxx_allocator_flag=new

> 	;;

>      esac

>    fi

> 

> which looks a bit redundant :-)


Right :-)

Thanks,

Christophe

> 

> Thanks,

> Richard

> .

>
From 81c84839b8f004b7b52317850f27f58e05bec6ad Mon Sep 17 00:00:00 2001
From: Christophe Lyon <christophe.lyon@linaro.org>

Date: Fri, 4 May 2018 15:11:35 +0000
Subject: [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in
 configure scripts

The new arm-uclinuxfdpiceabi target behaves pretty much like
arm-linux-gnueabi. In order the enable the same set of features, we
have to update several configure scripts that generally match targets
like *-*-linux*: in most places, we add *-uclinux* where there is
already *-linux*, or uclinux* when there is already linux*.

In gcc/config.gcc and libgcc/config.host we use *-*-uclinuxfdpiceabi
because there is already a different behaviour for *-*uclinux* target.

In libtool.m4, we use uclinuxfdpiceabi in cases where ELF shared
libraries support is required, as uclinux does not guarantee that.

2019-XX-XX  Christophe Lyon  <christophe.lyon@st.com>

	config/
	* futex.m4: Handle *-uclinux*.
	* tls.m4 (GCC_CHECK_TLS): Likewise.

	gcc/
	* config.gcc: Handle *-*-uclinuxfdpiceabi.

	libatomic/
	* configure.tgt: Handle arm*-*-uclinux*.
	* configure: Regenerate.

	libgcc/
	* config.host: Handle *-*-uclinuxfdpiceabi.

	libitm/
	* configure.tgt: Handle *-*-uclinux*.
	* configure: Regenerate.

Change-Id: Ib3a08905879ef917ee6c04c3988cf4ced7209fef

diff --git a/config/futex.m4 b/config/futex.m4
index e95144d..4dffe15 100644
--- a/config/futex.m4
+++ b/config/futex.m4
@@ -9,7 +9,7 @@ AC_DEFUN([GCC_LINUX_FUTEX],[dnl
 GCC_ENABLE(linux-futex,default, ,[use the Linux futex system call],
 	   permit yes|no|default)
 case "$target" in
-  *-linux*)
+  *-linux* | *-uclinux*)
     case "$enable_linux_futex" in
       default)
 	# If headers don't have gettid/futex syscalls definition, then
diff --git a/config/tls.m4 b/config/tls.m4
index 1a5fc59..7532305 100644
--- a/config/tls.m4
+++ b/config/tls.m4
@@ -76,7 +76,7 @@ AC_DEFUN([GCC_CHECK_TLS], [
 	  dnl Shared library options may depend on the host; this check
 	  dnl is only known to be needed for GNU/Linux.
 	  case $host in
-	    *-*-linux*)
+	    *-*-linux* | -*-uclinuxfdpic*)
 	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
 	      ;;
 	  esac
diff --git a/gcc/config.gcc b/gcc/config.gcc
index c7a464c..67780fb 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -776,7 +776,7 @@ case ${target} in
 *-*-fuchsia*)
   native_system_header_dir=/include
   ;;
-*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
+*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi)
   extra_options="$extra_options gnu-user.opt"
   gas=yes
   gnu_ld=yes
@@ -785,7 +785,7 @@ case ${target} in
   esac
   tmake_file="t-slibgcc"
   case $target in
-    *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu)
+    *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu  | *-*-uclinuxfdpiceabi)
       :;;
     *-*-gnu*)
       native_system_header_dir=/include
@@ -805,7 +805,7 @@ case ${target} in
     *-*-*android*)
       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC"
       ;;
-    *-*-*uclibc*)
+    *-*-*uclibc* | *-*-uclinuxfdpiceabi)
       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
       ;;
     *-*-*musl*)
@@ -1167,7 +1167,7 @@ arm*-*-netbsdelf*)
 	tmake_file="${tmake_file} arm/t-arm"
 	target_cpu_cname="strongarm"
 	;;
-arm*-*-linux-*)			# ARM GNU/Linux with ELF
+arm*-*-linux-* | arm*-*-uclinuxfdpiceabi)			# ARM GNU/Linux with ELF
 	tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
 	extra_options="${extra_options} linux-android.opt"
 	case $target in
diff --git a/libatomic/configure b/libatomic/configure
index e7076a0..10b0287 100755
--- a/libatomic/configure
+++ b/libatomic/configure
@@ -6055,7 +6055,7 @@ irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -8540,7 +8540,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -9135,7 +9135,7 @@ _LT_EOF
       archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
       tmp_diet=no
       if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
@@ -10666,7 +10666,7 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
index ecbb7d3..38e77ce 100644
--- a/libatomic/configure.tgt
+++ b/libatomic/configure.tgt
@@ -124,7 +124,7 @@ case "${target}" in
 	config_path="${config_path} linux/aarch64 posix"
 	;;
 
-  arm*-*-linux*)
+  arm*-*-linux* | arm*-*-uclinux*)
 	# OS support for atomic primitives.
 	config_path="${config_path} linux/arm posix"
 	;;
diff --git a/libgcc/config.host b/libgcc/config.host
index 91abc84..facca2a 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -245,7 +245,7 @@ case ${host} in
   tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-fuchsia"
   extra_parts="crtbegin.o crtend.o"
   ;;
-*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
+*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi)
   tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
   extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
   if test x$enable_vtable_verify = xyes; then
@@ -435,7 +435,7 @@ arm*-*-fuchsia*)
 arm*-*-netbsdelf*)
 	tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover"
 	;;
-arm*-*-linux*)			# ARM GNU/Linux with ELF
+arm*-*-linux* | arm*-*-uclinuxfdpiceabi)			# ARM GNU/Linux with ELF
 	tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm"
 	tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"
 	tm_file="$tm_file arm/bpabi-lib.h"
diff --git a/libitm/configure b/libitm/configure
index fb742d7..7b4c749 100644
--- a/libitm/configure
+++ b/libitm/configure
@@ -6731,7 +6731,7 @@ irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -9217,7 +9217,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -9812,7 +9812,7 @@ _LT_EOF
       archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
       tmp_diet=no
       if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
@@ -11343,7 +11343,7 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -13244,7 +13244,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
         inherit_rpath_CXX=yes
         ;;
 
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
         case $cc_basename in
           KCC*)
 	    # Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -13831,7 +13831,7 @@ interix[3-9]*)
   postdeps_CXX=
   ;;
 
-linux*)
+linux* | uclinux*)
   case `$CC -V 2>&1 | sed 5q` in
   *Sun\ C*)
     # Sun C++ 5.9
@@ -14082,7 +14082,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 	    ;;
 	esac
 	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)
 	case $cc_basename in
 	  KCC*)
 	    # KAI C++ Compiler
@@ -15003,7 +15003,7 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -16468,7 +16468,7 @@ fi
 
 
 case "$target" in
-  *-linux*)
+  *-linux* | *-uclinux*)
     case "$enable_linux_futex" in
       default)
 	# If headers don't have gettid/futex syscalls definition, then
@@ -16591,7 +16591,7 @@ _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   chktls_save_LDFLAGS="$LDFLAGS"
 	  	  	  case $host in
-	    *-*-linux*)
+	    *-*-linux* | -*-uclinux*)
 	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
 	      ;;
 	  esac
diff --git a/libitm/configure.tgt b/libitm/configure.tgt
index 4c0b602..eea865d 100644
--- a/libitm/configure.tgt
+++ b/libitm/configure.tgt
@@ -127,7 +127,7 @@ config_path="$ARCH posix generic"
 
 # Other system configury
 case "${target}" in
-  *-*-linux*)
+  *-*-linux* | *-*-uclinux*)
 	if test "$enable_linux_futex" = yes; then
 	  config_path="linux/$ARCH linux $config_path"
 	fi
diff --git a/libtool.m4 b/libtool.m4
index 8966762..64e507a 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -2449,7 +2449,12 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+
+# uclinux* changes (here and below) have been submitted to the libtool
+# project, but have not yet been accepted: they are GCC-local changes
+# for the time being.  (See
+# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -3089,7 +3094,7 @@ irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -3734,7 +3739,7 @@ m4_if([$1], [CXX], [
 	    ;;
 	esac
 	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)
 	case $cc_basename in
 	  KCC*)
 	    # KAI C++ Compiler
@@ -4032,7 +4037,7 @@ m4_if([$1], [CXX], [
       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -4449,7 +4454,7 @@ _LT_EOF
       _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
       tmp_diet=no
       if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
@@ -5946,7 +5951,7 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(inherit_rpath, $1)=yes
         ;;
 
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
         case $cc_basename in
           KCC*)
 	    # Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -6598,7 +6603,7 @@ interix[[3-9]]*)
   _LT_TAGVAR(postdeps,$1)=
   ;;
 
-linux*)
+linux* | uclinux*)
   case `$CC -V 2>&1 | sed 5q` in
   *Sun\ C*)
     # Sun C++ 5.9
-- 
2.6.3
From 28d59a36492d8370236dcf184b231db1ee985a79 Mon Sep 17 00:00:00 2001
From: Christophe Lyon <christophe.lyon@linaro.org>

Date: Thu, 29 Aug 2019 13:24:23 +0000
Subject: [ARM/FDPIC v6 24/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in
 libstdc++ configure scripts

2019-XX-XX  Christophe Lyon  <christophe.lyon@st.com>

        libstdc++-v3/
    	* acinclude.m4: Handle uclinux*.
    	* configure: Regenerate.
    	* configure.host: Handle uclinux*

Change-Id: Ia1b53693625e4153a090fcfc925a4d605bc98e59

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 84258d8..82377e8 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -1441,6 +1441,9 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [
         ac_has_nanosleep=yes
         ac_has_sched_yield=yes
         ;;
+      uclinux*)
+        ac_has_nanosleep=yes
+        ac_has_sched_yield=yes
     esac
 
   elif test x"$enable_libstdcxx_time" != x"no"; then
@@ -1526,7 +1529,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [
 
   if test x"$ac_has_clock_monotonic" != x"yes"; then
     case ${target_os} in
-      linux*)
+      linux* | uclinux*)
 	AC_MSG_CHECKING([for clock_gettime syscall])
 	AC_TRY_COMPILE(
 	  [#include <unistd.h>
@@ -4361,7 +4364,7 @@ AC_DEFUN([GLIBCXX_ENABLE_FILESYSTEM_TS], [
       freebsd*|netbsd*|openbsd*|dragonfly*|darwin*)
         enable_libstdcxx_filesystem_ts=yes
         ;;
-      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
+      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)
         enable_libstdcxx_filesystem_ts=yes
         ;;
       rtems*)
@@ -4543,7 +4546,7 @@ dnl
     AC_MSG_CHECKING([for sendfile that can copy files])
     AC_CACHE_VAL(glibcxx_cv_sendfile, [dnl
       case "${target_os}" in
-        gnu* | linux* | solaris*)
+        gnu* | linux* | solaris* | uclinux*)
           GCC_TRY_COMPILE_OR_LINK(
             [#include <sys/sendfile.h>],
             [sendfile(1, 2, (off_t*)0, sizeof 1);],
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 7d134a0..91873b8 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -6652,7 +6652,7 @@ irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -9003,7 +9003,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -9598,7 +9598,7 @@ _LT_EOF
       archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
       tmp_diet=no
       if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
@@ -11138,7 +11138,7 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -13063,7 +13063,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
         inherit_rpath_CXX=yes
         ;;
 
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
         case $cc_basename in
           KCC*)
 	    # Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -13650,7 +13650,7 @@ interix[3-9]*)
   postdeps_CXX=
   ;;
 
-linux*)
+linux* | uclinux*)
   case `$CC -V 2>&1 | sed 5q` in
   *Sun\ C*)
     # Sun C++ 5.9
@@ -13901,7 +13901,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 	    ;;
 	esac
 	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)
 	case $cc_basename in
 	  KCC*)
 	    # KAI C++ Compiler
@@ -14822,7 +14822,7 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -16143,7 +16143,7 @@ fi
   # Default to "generic".
   if test $enable_clocale_flag = auto; then
     case ${target_os} in
-      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)
 	enable_clocale_flag=gnu
 	;;
       darwin*)
@@ -16560,7 +16560,7 @@ fi
   # Default to "new".
   if test $enable_libstdcxx_allocator_flag = auto; then
     case ${target_os} in
-      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)
 	enable_libstdcxx_allocator_flag=new
 	;;
       *)
@@ -20834,7 +20834,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
         ac_has_nanosleep=yes
         ac_has_sched_yield=yes
         ;;
-      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
+      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for at least GNU libc 2.17" >&5
 $as_echo_n "checking for at least GNU libc 2.17... " >&6; }
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -21334,7 +21334,7 @@ $as_echo "$ac_has_nanosleep" >&6; }
 
   if test x"$ac_has_clock_monotonic" != x"yes"; then
     case ${target_os} in
-      linux*)
+      linux* | uclinux*)
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime syscall" >&5
 $as_echo_n "checking for clock_gettime syscall... " >&6; }
 	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -28220,7 +28220,7 @@ _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   chktls_save_LDFLAGS="$LDFLAGS"
 	  	  	  case $host in
-	    *-*-linux*)
+	    *-*-linux* | -*-uclinux*)
 	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
 	      ;;
 	  esac
@@ -53895,7 +53895,7 @@ _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   chktls_save_LDFLAGS="$LDFLAGS"
 	  	  	  case $host in
-	    *-*-linux*)
+	    *-*-linux* | -*-uclinux*)
 	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
 	      ;;
 	  esac
@@ -60082,7 +60082,7 @@ _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   chktls_save_LDFLAGS="$LDFLAGS"
 	  	  	  case $host in
-	    *-*-linux*)
+	    *-*-linux* | -*-uclinux*)
 	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
 	      ;;
 	  esac
@@ -78725,7 +78725,7 @@ fi
 
 
 case "$target" in
-  *-linux*)
+  *-linux* | *-uclinux*)
     case "$enable_linux_futex" in
       default)
 	# If headers don't have gettid/futex syscalls definition, then
@@ -80354,7 +80354,7 @@ $as_echo_n "checking whether to build Filesystem TS support... " >&6; }
       freebsd*|netbsd*|openbsd*|dragonfly*|darwin*)
         enable_libstdcxx_filesystem_ts=yes
         ;;
-      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
+      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)
         enable_libstdcxx_filesystem_ts=yes
         ;;
       rtems*)
@@ -80906,7 +80906,7 @@ $as_echo_n "checking for sendfile that can copy files... " >&6; }
   $as_echo_n "(cached) " >&6
 else
         case "${target_os}" in
-        gnu* | linux* | solaris*)
+        gnu* | linux* | solaris* | uclinux*)
           if test x$gcc_no_link = xyes; then
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
index f2ff129..ae156fc 100644
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -264,7 +264,7 @@ case "${host_os}" in
   linux-musl*)
     os_include_dir="os/generic"
     ;;
-  gnu* | linux* | kfreebsd*-gnu)
+  gnu* | linux* | kfreebsd*-gnu | uclinux*)
     if [ "$uclibc" = "yes" ]; then
       os_include_dir="os/uclibc"
     elif [ "$bionic" = "yes" ]; then
@@ -327,7 +327,7 @@ esac
 # Set any OS-dependent and CPU-dependent bits.
 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
 case "${host}" in
-  *-*-linux*)
+  *-*-linux* | *-*-uclinux*)
     case "${host_cpu}" in
       i[567]86)
         abi_baseline_pair=i486-linux-gnu
@@ -361,7 +361,7 @@ case "${host}" in
         fi
     esac
     case "${host}" in
-      arm*-*-linux-*)
+      arm*-*-linux-* | arm*-*-uclinuxfdpiceabi)
 	port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
 	;;
     esac
-- 
2.6.3
Richard Sandiford Aug. 30, 2019, 9 a.m. | #5
Christophe Lyon <christophe.lyon@st.com> writes:
> @@ -785,7 +785,7 @@ case ${target} in

>    esac

>    tmake_file="t-slibgcc"

>    case $target in

> -    *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu)

> +    *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu  | *-*-uclinuxfdpiceabi)

>        :;;

>      *-*-gnu*)

>        native_system_header_dir=/include


I don't think this is necessary, since this target will never match the
following *-*-gnu*) stanza anyway.

> diff --git a/libtool.m4 b/libtool.m4

> index 8966762..64e507a 100644

> --- a/libtool.m4

> +++ b/libtool.m4

> @@ -3734,7 +3739,7 @@ m4_if([$1], [CXX], [

>  	    ;;

>  	esac

>  	;;

> -      linux* | k*bsd*-gnu | kopensolaris*-gnu)

> +      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)

>  	case $cc_basename in

>  	  KCC*)

>  	    # KAI C++ Compiler


Is this needed?  It seems to be in the !GCC branch of an if/else.

If it is needed, the default:

	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no

seems correct for non-FDPIC uclinux.

> @@ -4032,7 +4037,7 @@ m4_if([$1], [CXX], [

>        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'

>        ;;

>  

> -    linux* | k*bsd*-gnu | kopensolaris*-gnu)

> +    linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)

>        case $cc_basename in

>        # old Intel for x86_64 which still supported -KPIC.

>        ecc*)


Same here.

> @@ -5946,7 +5951,7 @@ if test "$_lt_caught_CXX_error" != yes; then

>          _LT_TAGVAR(inherit_rpath, $1)=yes

>          ;;

>  

> -      linux* | k*bsd*-gnu | kopensolaris*-gnu)

> +      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)

>          case $cc_basename in

>            KCC*)

>  	    # Kuck and Associates, Inc. (KAI) C++ Compiler


Here too the code seems to be dealing specifically with non-GCC compilers.

> @@ -6598,7 +6603,7 @@ interix[[3-9]]*)

>    _LT_TAGVAR(postdeps,$1)=

>    ;;

>  

> -linux*)

> +linux* | uclinux*)

>    case `$CC -V 2>&1 | sed 5q` in

>    *Sun\ C*)

>      # Sun C++ 5.9


Here too.  (It only seems to do anything for Sun's C compiler.)

The fewer hunks we have to maintain downstream the better :-)

Richard
Jonathan Wakely Aug. 30, 2019, 2:31 p.m. | #6
On 29/08/19 16:54 +0200, Christophe Lyon wrote:
>On 12/07/2019 08:49, Richard Sandiford wrote:

>>Christophe Lyon <christophe.lyon@st.com> writes:

>>>The new arm-uclinuxfdpiceabi target behaves pretty much like

>>>arm-linux-gnueabi. In order the enable the same set of features, we

>>>have to update several configure scripts that generally match targets

>>>like *-*-linux*: in most places, we add *-uclinux* where there is

>>>already *-linux*, or uclinux* when there is already linux*.

>>>

>>>In gcc/config.gcc and libgcc/config.host we use *-*-uclinuxfdpiceabi

>>>because there is already a different behaviour for *-*uclinux* target.

>>>

>>>In libtool.m4, we use uclinuxfdpiceabi in cases where ELF shared

>>>libraries support is required, as uclinux does not guarantee that.

>>>

>>>2019-XX-XX  Christophe Lyon  <christophe.lyon@st.com>

>>>

>>>	config/

>>>	* futex.m4: Handle *-uclinux*.

>>>	* tls.m4 (GCC_CHECK_TLS): Likewise.

>>>

>>>	gcc/

>>>	* config.gcc: Handle *-*-uclinuxfdpiceabi.

>>>

>>>	libatomic/

>>>	* configure.tgt: Handle arm*-*-uclinux*.

>>>	* configure: Regenerate.

>>>

>>>	libgcc/

>>>	* config.host: Handle *-*-uclinuxfdpiceabi.

>>>

>>>	libitm/

>>>	* configure.tgt: Handle *-*-uclinux*.

>>>	* configure: Regenerate.

>>>

>>>	libstdc++-v3/

>>>	* acinclude.m4: Handle uclinux*.

>>>	* configure: Regenerate.

>>>	* configure.host: Handle uclinux*

>>>

>>>	* libtool.m4: Handle uclinux*.

>>

>>Has the libtool.m4 patch been submitted to upstream libtool?

>>I think this is supposed to be handled by submitting there first

>>and then cherry-picking into gcc, so that the change isn't lost

>>by a future import.

>>

>I added a comment to libtool.m4 about this.

>

>>>[...]

>>>

>>>diff --git a/config/tls.m4 b/config/tls.m4

>>>index 1a5fc59..a487aa4 100644

>>>--- a/config/tls.m4

>>>+++ b/config/tls.m4

>>>@@ -76,7 +76,7 @@ AC_DEFUN([GCC_CHECK_TLS], [

>>>  	  dnl Shared library options may depend on the host; this check

>>>  	  dnl is only known to be needed for GNU/Linux.

>>>  	  case $host in

>>>-	    *-*-linux*)

>>>+	    *-*-linux* | -*-uclinux*)

>>>  	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"

>>>  	      ;;

>>>  	  esac

>>

>>Is this right for all uclinux targets?

>I don't think so, now restricted to -*-uclinuxfdpic*

>

>>

>>>diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4

>>>index 84258d8..cb0fdc5 100644

>>>--- a/libstdc++-v3/acinclude.m4

>>>+++ b/libstdc++-v3/acinclude.m4

>>

>>It'd probably be worth splitting out the libstdc++-v3 bits and

>>submitting them separately, cc:ing libstdc++@gcc.gnu.org.  But...

>

>I've now split the patch into two parts (both attached here)

>>

>>>@@ -1404,7 +1404,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [

>>>          ac_has_nanosleep=yes

>>>          ac_has_sched_yield=yes

>>>          ;;

>>>-      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)

>>>+      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)

>>>          AC_MSG_CHECKING([for at least GNU libc 2.17])

>>>          AC_TRY_COMPILE(

>>>            [#include <features.h>],

>>

>>is this the right thing to do?  It seems odd to be testing the glibc

>>version for uclibc.

>>

>>Do you want to support multiple possible settings of

>>ac_has_clock_monotonic and ac_has_clock_realtime?  Or could you just

>>hard-code the values, given particular baseline assumptions about the

>>version of uclibc etc.?  Hard-coding would then make....

>>

>>>@@ -1526,7 +1526,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [

>>>    if test x"$ac_has_clock_monotonic" != x"yes"; then

>>>      case ${target_os} in

>>>-      linux*)

>>>+      linux* | uclinux*)

>>>  	AC_MSG_CHECKING([for clock_gettime syscall])

>>>  	AC_TRY_COMPILE(

>>>  	  [#include <unistd.h>

>>

>>...this redundant.

>>

>Right, now fixed.

>

>>>@@ -2415,7 +2415,7 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [

>>>    # Default to "generic".

>>>    if test $enable_clocale_flag = auto; then

>>>      case ${target_os} in

>>>-      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)

>>>+      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)

>>>  	enable_clocale_flag=gnu

>>>  	;;

>>>        darwin*)

>>

>>This too seems to be choosing a glibc setting for a uclibc target.

>Indeed.

>

>>

>>>@@ -2661,7 +2661,7 @@ AC_DEFUN([GLIBCXX_ENABLE_ALLOCATOR], [

>>>    # Default to "new".

>>>    if test $enable_libstdcxx_allocator_flag = auto; then

>>>      case ${target_os} in

>>>-      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)

>>>+      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)

>>>  	enable_libstdcxx_allocator_flag=new

>>>  	;;

>>>        *)

>>

>>The full case is:

>>

>>   # Probe for host-specific support if no specific model is specified.

>>   # Default to "new".

>>   if test $enable_libstdcxx_allocator_flag = auto; then

>>     case ${target_os} in

>>       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)

>>	enable_libstdcxx_allocator_flag=new

>>	;;

>>       *)

>>	enable_libstdcxx_allocator_flag=new

>>	;;

>>     esac

>>   fi

>>

>>which looks a bit redundant :-)

>

>Right :-)

>

>Thanks,

>

>Christophe

>

>>

>>Thanks,

>>Richard

>>.

>>

>


>From 81c84839b8f004b7b52317850f27f58e05bec6ad Mon Sep 17 00:00:00 2001

>From: Christophe Lyon <christophe.lyon@linaro.org>

>Date: Fri, 4 May 2018 15:11:35 +0000

>Subject: [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in

> configure scripts

>

>The new arm-uclinuxfdpiceabi target behaves pretty much like

>arm-linux-gnueabi. In order the enable the same set of features, we


s/In order the enable/In order to enable/

The libstdc++ part is OK for trunk.
Christophe Lyon Aug. 30, 2019, 2:35 p.m. | #7
On Fri, 30 Aug 2019 at 11:00, Richard Sandiford
<richard.sandiford@arm.com> wrote:
>

> Christophe Lyon <christophe.lyon@st.com> writes:

> > @@ -785,7 +785,7 @@ case ${target} in

> >    esac

> >    tmake_file="t-slibgcc"

> >    case $target in

> > -    *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu)

> > +    *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu  | *-*-uclinuxfdpiceabi)

> >        :;;

> >      *-*-gnu*)

> >        native_system_header_dir=/include

>

> I don't think this is necessary, since this target will never match the

> following *-*-gnu*) stanza anyway.

OK (I thought it was clearer to add the fdpic config where we already
have linux that would not match)

>

> > diff --git a/libtool.m4 b/libtool.m4

> > index 8966762..64e507a 100644

> > --- a/libtool.m4

> > +++ b/libtool.m4

> > @@ -3734,7 +3739,7 @@ m4_if([$1], [CXX], [

> >           ;;

> >       esac

> >       ;;

> > -      linux* | k*bsd*-gnu | kopensolaris*-gnu)

> > +      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)

> >       case $cc_basename in

> >         KCC*)

> >           # KAI C++ Compiler

>

> Is this needed?  It seems to be in the !GCC branch of an if/else.

I must admit I didn't test this case. I thought it was needed because
this target does not match "linux*", in case someone tries to compile
with another compiler...


>

> If it is needed, the default:

>

>         _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no

>

> seems correct for non-FDPIC uclinux.

>

So, either use uclinuxfdpiceabi above, or do nothing and do not try to
support other compilers?

> > @@ -4032,7 +4037,7 @@ m4_if([$1], [CXX], [

> >        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'

> >        ;;

> >

> > -    linux* | k*bsd*-gnu | kopensolaris*-gnu)

> > +    linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)

> >        case $cc_basename in

> >        # old Intel for x86_64 which still supported -KPIC.

> >        ecc*)

>

> Same here.

>

> > @@ -5946,7 +5951,7 @@ if test "$_lt_caught_CXX_error" != yes; then

> >          _LT_TAGVAR(inherit_rpath, $1)=yes

> >          ;;

> >

> > -      linux* | k*bsd*-gnu | kopensolaris*-gnu)

> > +      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)

> >          case $cc_basename in

> >            KCC*)

> >           # Kuck and Associates, Inc. (KAI) C++ Compiler

>

> Here too the code seems to be dealing specifically with non-GCC compilers.

>

> > @@ -6598,7 +6603,7 @@ interix[[3-9]]*)

> >    _LT_TAGVAR(postdeps,$1)=

> >    ;;

> >

> > -linux*)

> > +linux* | uclinux*)

> >    case `$CC -V 2>&1 | sed 5q` in

> >    *Sun\ C*)

> >      # Sun C++ 5.9

>

> Here too.  (It only seems to do anything for Sun's C compiler.)

>

> The fewer hunks we have to maintain downstream the better :-)

>

Sure.

I thought safer/cleaner to prepare the cases for non-GCC compilers, I
guess it's better not to add that until proven useful?

Thanks,

Christophe


> Richard
Richard Sandiford Aug. 30, 2019, 2:49 p.m. | #8
Christophe Lyon <christophe.lyon@linaro.org> writes:
> On Fri, 30 Aug 2019 at 11:00, Richard Sandiford

> <richard.sandiford@arm.com> wrote:

>>

>> Christophe Lyon <christophe.lyon@st.com> writes:

>> > @@ -785,7 +785,7 @@ case ${target} in

>> >    esac

>> >    tmake_file="t-slibgcc"

>> >    case $target in

>> > -    *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu)

>> > +    *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu  | *-*-uclinuxfdpiceabi)

>> >        :;;

>> >      *-*-gnu*)

>> >        native_system_header_dir=/include

>>

>> I don't think this is necessary, since this target will never match the

>> following *-*-gnu*) stanza anyway.

> OK (I thought it was clearer to add the fdpic config where we already

> have linux that would not match)


I think the idea is to match pure GNU systems only in the second stanza
(i.e. GNU/Hurd).  So we need the first stanza to exclude hybrid-GNU
systems like GNU/Linux, GNU/Solaris, GNU/FreeBSD, etc.

Since uclinuxfdpiceabi isn't a GNU-based system, I don't think it
needs to appear at all.

>> > diff --git a/libtool.m4 b/libtool.m4

>> > index 8966762..64e507a 100644

>> > --- a/libtool.m4

>> > +++ b/libtool.m4

>> > @@ -3734,7 +3739,7 @@ m4_if([$1], [CXX], [

>> >           ;;

>> >       esac

>> >       ;;

>> > -      linux* | k*bsd*-gnu | kopensolaris*-gnu)

>> > +      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)

>> >       case $cc_basename in

>> >         KCC*)

>> >           # KAI C++ Compiler

>>

>> Is this needed?  It seems to be in the !GCC branch of an if/else.

> I must admit I didn't test this case. I thought it was needed because

> this target does not match "linux*", in case someone tries to compile

> with another compiler...

>

>

>>

>> If it is needed, the default:

>>

>>         _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no

>>

>> seems correct for non-FDPIC uclinux.

>>

> So, either use uclinuxfdpiceabi above, or do nothing and do not try to

> support other compilers?


Yeah.  I think the latter's better, since in this context we only
need libtool.m4 to support building with GCC.  The decision might
be different for upstream libtool, but do any commercial compilers
support Arm FDPIC yet?

>> > @@ -4032,7 +4037,7 @@ m4_if([$1], [CXX], [

>> >        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'

>> >        ;;

>> >

>> > -    linux* | k*bsd*-gnu | kopensolaris*-gnu)

>> > +    linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)

>> >        case $cc_basename in

>> >        # old Intel for x86_64 which still supported -KPIC.

>> >        ecc*)

>>

>> Same here.

>>

>> > @@ -5946,7 +5951,7 @@ if test "$_lt_caught_CXX_error" != yes; then

>> >          _LT_TAGVAR(inherit_rpath, $1)=yes

>> >          ;;

>> >

>> > -      linux* | k*bsd*-gnu | kopensolaris*-gnu)

>> > +      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)

>> >          case $cc_basename in

>> >            KCC*)

>> >           # Kuck and Associates, Inc. (KAI) C++ Compiler

>>

>> Here too the code seems to be dealing specifically with non-GCC compilers.

>>

>> > @@ -6598,7 +6603,7 @@ interix[[3-9]]*)

>> >    _LT_TAGVAR(postdeps,$1)=

>> >    ;;

>> >

>> > -linux*)

>> > +linux* | uclinux*)

>> >    case `$CC -V 2>&1 | sed 5q` in

>> >    *Sun\ C*)

>> >      # Sun C++ 5.9

>>

>> Here too.  (It only seems to do anything for Sun's C compiler.)

>>

>> The fewer hunks we have to maintain downstream the better :-)

>>

> Sure.

>

> I thought safer/cleaner to prepare the cases for non-GCC compilers, I

> guess it's better not to add that until proven useful?


Yeah, I think so.  I guess it depends on your POV.  To me, it seems
cleaner to add uclinux* and uclinuxfdpiceabi only where we know there's
a specific need, since that's also how we decide which of uclinux* and
uclinuxfdpiceabi to use.

Thanks,
Richard
Christophe Lyon Sept. 2, 2019, 7:51 a.m. | #9
On Fri, 30 Aug 2019 at 16:49, Richard Sandiford
<richard.sandiford@arm.com> wrote:
>

> Christophe Lyon <christophe.lyon@linaro.org> writes:

> > On Fri, 30 Aug 2019 at 11:00, Richard Sandiford

> > <richard.sandiford@arm.com> wrote:

> >>

> >> Christophe Lyon <christophe.lyon@st.com> writes:

> >> > @@ -785,7 +785,7 @@ case ${target} in

> >> >    esac

> >> >    tmake_file="t-slibgcc"

> >> >    case $target in

> >> > -    *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu)

> >> > +    *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu  | *-*-uclinuxfdpiceabi)

> >> >        :;;

> >> >      *-*-gnu*)

> >> >        native_system_header_dir=/include

> >>

> >> I don't think this is necessary, since this target will never match the

> >> following *-*-gnu*) stanza anyway.

> > OK (I thought it was clearer to add the fdpic config where we already

> > have linux that would not match)

>

> I think the idea is to match pure GNU systems only in the second stanza

> (i.e. GNU/Hurd).  So we need the first stanza to exclude hybrid-GNU

> systems like GNU/Linux, GNU/Solaris, GNU/FreeBSD, etc.

>

> Since uclinuxfdpiceabi isn't a GNU-based system, I don't think it

> needs to appear at all.

>

> >> > diff --git a/libtool.m4 b/libtool.m4

> >> > index 8966762..64e507a 100644

> >> > --- a/libtool.m4

> >> > +++ b/libtool.m4

> >> > @@ -3734,7 +3739,7 @@ m4_if([$1], [CXX], [

> >> >           ;;

> >> >       esac

> >> >       ;;

> >> > -      linux* | k*bsd*-gnu | kopensolaris*-gnu)

> >> > +      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)

> >> >       case $cc_basename in

> >> >         KCC*)

> >> >           # KAI C++ Compiler

> >>

> >> Is this needed?  It seems to be in the !GCC branch of an if/else.

> > I must admit I didn't test this case. I thought it was needed because

> > this target does not match "linux*", in case someone tries to compile

> > with another compiler...

> >

> >

> >>

> >> If it is needed, the default:

> >>

> >>         _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no

> >>

> >> seems correct for non-FDPIC uclinux.

> >>

> > So, either use uclinuxfdpiceabi above, or do nothing and do not try to

> > support other compilers?

>

> Yeah.  I think the latter's better, since in this context we only

> need libtool.m4 to support building with GCC.  The decision might

> be different for upstream libtool, but do any commercial compilers

> support Arm FDPIC yet?

>

> >> > @@ -4032,7 +4037,7 @@ m4_if([$1], [CXX], [

> >> >        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'

> >> >        ;;

> >> >

> >> > -    linux* | k*bsd*-gnu | kopensolaris*-gnu)

> >> > +    linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)

> >> >        case $cc_basename in

> >> >        # old Intel for x86_64 which still supported -KPIC.

> >> >        ecc*)

> >>

> >> Same here.

> >>

> >> > @@ -5946,7 +5951,7 @@ if test "$_lt_caught_CXX_error" != yes; then

> >> >          _LT_TAGVAR(inherit_rpath, $1)=yes

> >> >          ;;

> >> >

> >> > -      linux* | k*bsd*-gnu | kopensolaris*-gnu)

> >> > +      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)

> >> >          case $cc_basename in

> >> >            KCC*)

> >> >           # Kuck and Associates, Inc. (KAI) C++ Compiler

> >>

> >> Here too the code seems to be dealing specifically with non-GCC compilers.

> >>

> >> > @@ -6598,7 +6603,7 @@ interix[[3-9]]*)

> >> >    _LT_TAGVAR(postdeps,$1)=

> >> >    ;;

> >> >

> >> > -linux*)

> >> > +linux* | uclinux*)

> >> >    case `$CC -V 2>&1 | sed 5q` in

> >> >    *Sun\ C*)

> >> >      # Sun C++ 5.9

> >>

> >> Here too.  (It only seems to do anything for Sun's C compiler.)

> >>

> >> The fewer hunks we have to maintain downstream the better :-)

> >>

> > Sure.

> >

> > I thought safer/cleaner to prepare the cases for non-GCC compilers, I

> > guess it's better not to add that until proven useful?

>

> Yeah, I think so.  I guess it depends on your POV.  To me, it seems

> cleaner to add uclinux* and uclinuxfdpiceabi only where we know there's

> a specific need, since that's also how we decide which of uclinux* and

> uclinuxfdpiceabi to use.

>


OK, here is an updated version of this patch.

Christophe

> Thanks,

> Richard
commit 0dbd18d60be654fa2ff2ae85670cc096db5217a5
Author: Christophe Lyon <christophe.lyon@linaro.org>
Date:   Fri May 4 15:11:35 2018 +0000

    [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts
    
    The new arm-uclinuxfdpiceabi target behaves pretty much like
    arm-linux-gnueabi. In order to enable the same set of features, we
    have to update several configure scripts that generally match targets
    like *-*-linux*: in most places, we add *-uclinux* where there is
    already *-linux*, or uclinux* when there is already linux*.
    
    In gcc/config.gcc and libgcc/config.host we use *-*-uclinuxfdpiceabi
    because there is already a different behaviour for *-*uclinux* target.
    
    In libtool.m4, we use uclinuxfdpiceabi in cases where ELF shared
    libraries support is required, as uclinux does not guarantee that.
    
    2019-XX-XX  Christophe Lyon  <christophe.lyon@st.com>
    
    	config/
    	* futex.m4: Handle *-uclinux*.
    	* tls.m4 (GCC_CHECK_TLS): Likewise.
    
    	gcc/
    	* config.gcc: Handle *-*-uclinuxfdpiceabi.
    
    	libatomic/
    	* configure.tgt: Handle arm*-*-uclinux*.
    	* configure: Regenerate.
    
    	libgcc/
    	* config.host: Handle *-*-uclinuxfdpiceabi.
    
    	libitm/
    	* configure.tgt: Handle *-*-uclinux*.
    	* configure: Regenerate.
    
    	* libtool.m4: Handle uclinuxfdpiceabi.
    
    Change-Id: Ib3a08905879ef917ee6c04c3988cf4ced7209fef

diff --git a/config/futex.m4 b/config/futex.m4
index e95144d..4dffe15 100644
--- a/config/futex.m4
+++ b/config/futex.m4
@@ -9,7 +9,7 @@ AC_DEFUN([GCC_LINUX_FUTEX],[dnl
 GCC_ENABLE(linux-futex,default, ,[use the Linux futex system call],
 	   permit yes|no|default)
 case "$target" in
-  *-linux*)
+  *-linux* | *-uclinux*)
     case "$enable_linux_futex" in
       default)
 	# If headers don't have gettid/futex syscalls definition, then
diff --git a/config/tls.m4 b/config/tls.m4
index 1a5fc59..7532305 100644
--- a/config/tls.m4
+++ b/config/tls.m4
@@ -76,7 +76,7 @@ AC_DEFUN([GCC_CHECK_TLS], [
 	  dnl Shared library options may depend on the host; this check
 	  dnl is only known to be needed for GNU/Linux.
 	  case $host in
-	    *-*-linux*)
+	    *-*-linux* | -*-uclinuxfdpic*)
 	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
 	      ;;
 	  esac
diff --git a/gcc/config.gcc b/gcc/config.gcc
index c7a464c..721729d 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -776,7 +776,7 @@ case ${target} in
 *-*-fuchsia*)
   native_system_header_dir=/include
   ;;
-*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
+*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi)
   extra_options="$extra_options gnu-user.opt"
   gas=yes
   gnu_ld=yes
@@ -805,7 +805,7 @@ case ${target} in
     *-*-*android*)
       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC"
       ;;
-    *-*-*uclibc*)
+    *-*-*uclibc* | *-*-uclinuxfdpiceabi)
       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
       ;;
     *-*-*musl*)
@@ -1167,7 +1167,7 @@ arm*-*-netbsdelf*)
 	tmake_file="${tmake_file} arm/t-arm"
 	target_cpu_cname="strongarm"
 	;;
-arm*-*-linux-*)			# ARM GNU/Linux with ELF
+arm*-*-linux-* | arm*-*-uclinuxfdpiceabi)			# ARM GNU/Linux with ELF
 	tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
 	extra_options="${extra_options} linux-android.opt"
 	case $target in
diff --git a/libatomic/configure b/libatomic/configure
index e7076a0..92bd26a 100755
--- a/libatomic/configure
+++ b/libatomic/configure
@@ -6055,7 +6055,7 @@ irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -9135,7 +9135,7 @@ _LT_EOF
       archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
       tmp_diet=no
       if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
@@ -10666,7 +10666,12 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+
+# uclinux* changes (here and below) have been submitted to the libtool
+# project, but have not yet been accepted: they are GCC-local changes
+# for the time being.  (See
+# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
index ecbb7d3..38e77ce 100644
--- a/libatomic/configure.tgt
+++ b/libatomic/configure.tgt
@@ -124,7 +124,7 @@ case "${target}" in
 	config_path="${config_path} linux/aarch64 posix"
 	;;
 
-  arm*-*-linux*)
+  arm*-*-linux* | arm*-*-uclinux*)
 	# OS support for atomic primitives.
 	config_path="${config_path} linux/arm posix"
 	;;
diff --git a/libgcc/config.host b/libgcc/config.host
index 91abc84..facca2a 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -245,7 +245,7 @@ case ${host} in
   tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-fuchsia"
   extra_parts="crtbegin.o crtend.o"
   ;;
-*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
+*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi)
   tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
   extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
   if test x$enable_vtable_verify = xyes; then
@@ -435,7 +435,7 @@ arm*-*-fuchsia*)
 arm*-*-netbsdelf*)
 	tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover"
 	;;
-arm*-*-linux*)			# ARM GNU/Linux with ELF
+arm*-*-linux* | arm*-*-uclinuxfdpiceabi)			# ARM GNU/Linux with ELF
 	tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm"
 	tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"
 	tm_file="$tm_file arm/bpabi-lib.h"
diff --git a/libitm/configure b/libitm/configure
old mode 100644
new mode 100755
index fb742d7..fc679c8
--- a/libitm/configure
+++ b/libitm/configure
@@ -6731,7 +6731,7 @@ irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -9812,7 +9812,7 @@ _LT_EOF
       archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
       tmp_diet=no
       if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
@@ -11343,7 +11343,12 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+
+# uclinux* changes (here and below) have been submitted to the libtool
+# project, but have not yet been accepted: they are GCC-local changes
+# for the time being.  (See
+# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -15003,7 +15008,12 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+
+# uclinux* changes (here and below) have been submitted to the libtool
+# project, but have not yet been accepted: they are GCC-local changes
+# for the time being.  (See
+# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -16468,7 +16478,7 @@ fi
 
 
 case "$target" in
-  *-linux*)
+  *-linux* | *-uclinux*)
     case "$enable_linux_futex" in
       default)
 	# If headers don't have gettid/futex syscalls definition, then
@@ -16591,7 +16601,7 @@ _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   chktls_save_LDFLAGS="$LDFLAGS"
 	  	  	  case $host in
-	    *-*-linux*)
+	    *-*-linux* | -*-uclinuxfdpic*)
 	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
 	      ;;
 	  esac
diff --git a/libitm/configure.tgt b/libitm/configure.tgt
index 4c0b602..eea865d 100644
--- a/libitm/configure.tgt
+++ b/libitm/configure.tgt
@@ -127,7 +127,7 @@ config_path="$ARCH posix generic"
 
 # Other system configury
 case "${target}" in
-  *-*-linux*)
+  *-*-linux* | *-*-uclinux*)
 	if test "$enable_linux_futex" = yes; then
 	  config_path="linux/$ARCH linux $config_path"
 	fi
diff --git a/libtool.m4 b/libtool.m4
index 8966762..e194e89 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -2449,7 +2449,12 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+
+# uclinux* changes (here and below) have been submitted to the libtool
+# project, but have not yet been accepted: they are GCC-local changes
+# for the time being.  (See
+# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -3089,7 +3094,7 @@ irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -4449,7 +4454,7 @@ _LT_EOF
       _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
       tmp_diet=no
       if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
Richard Sandiford Sept. 2, 2019, 8:31 a.m. | #10
Christophe Lyon <christophe.lyon@linaro.org> writes:
> diff --git a/gcc/config.gcc b/gcc/config.gcc

> index c7a464c..721729d 100644

> --- a/gcc/config.gcc

> +++ b/gcc/config.gcc

> @@ -1167,7 +1167,7 @@ arm*-*-netbsdelf*)

>  	tmake_file="${tmake_file} arm/t-arm"

>  	target_cpu_cname="strongarm"

>  	;;

> -arm*-*-linux-*)			# ARM GNU/Linux with ELF

> +arm*-*-linux-* | arm*-*-uclinuxfdpiceabi)			# ARM GNU/Linux with ELF

>  	tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"

>  	extra_options="${extra_options} linux-android.opt"

>  	case $target in


Better to remove the "# ARM GNU/Linux with ELF" comment too, since it
doesn't cover the new case and was already misleading given the
bionic support.

> diff --git a/libgcc/config.host b/libgcc/config.host

> index 91abc84..facca2a 100644

> --- a/libgcc/config.host

> +++ b/libgcc/config.host

> @@ -435,7 +435,7 @@ arm*-*-fuchsia*)

>  arm*-*-netbsdelf*)

>  	tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover"

>  	;;

> -arm*-*-linux*)			# ARM GNU/Linux with ELF

> +arm*-*-linux* | arm*-*-uclinuxfdpiceabi)			# ARM GNU/Linux with ELF

>  	tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm"

>  	tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"

>  	tm_file="$tm_file arm/bpabi-lib.h"


Same here.

OK with those changes, thanks.

Richard

Patch

diff --git a/config/futex.m4 b/config/futex.m4
index e95144d..4dffe15 100644
--- a/config/futex.m4
+++ b/config/futex.m4
@@ -9,7 +9,7 @@  AC_DEFUN([GCC_LINUX_FUTEX],[dnl
 GCC_ENABLE(linux-futex,default, ,[use the Linux futex system call],
 	   permit yes|no|default)
 case "$target" in
-  *-linux*)
+  *-linux* | *-uclinux*)
     case "$enable_linux_futex" in
       default)
 	# If headers don't have gettid/futex syscalls definition, then
diff --git a/config/tls.m4 b/config/tls.m4
index 1a5fc59..a487aa4 100644
--- a/config/tls.m4
+++ b/config/tls.m4
@@ -76,7 +76,7 @@  AC_DEFUN([GCC_CHECK_TLS], [
 	  dnl Shared library options may depend on the host; this check
 	  dnl is only known to be needed for GNU/Linux.
 	  case $host in
-	    *-*-linux*)
+	    *-*-linux* | -*-uclinux*)
 	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
 	      ;;
 	  esac
diff --git a/gcc/config.gcc b/gcc/config.gcc
index c7a464c..67780fb 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -776,7 +776,7 @@  case ${target} in
 *-*-fuchsia*)
   native_system_header_dir=/include
   ;;
-*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
+*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi)
   extra_options="$extra_options gnu-user.opt"
   gas=yes
   gnu_ld=yes
@@ -785,7 +785,7 @@  case ${target} in
   esac
   tmake_file="t-slibgcc"
   case $target in
-    *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu)
+    *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu  | *-*-uclinuxfdpiceabi)
       :;;
     *-*-gnu*)
       native_system_header_dir=/include
@@ -805,7 +805,7 @@  case ${target} in
     *-*-*android*)
       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC"
       ;;
-    *-*-*uclibc*)
+    *-*-*uclibc* | *-*-uclinuxfdpiceabi)
       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
       ;;
     *-*-*musl*)
@@ -1167,7 +1167,7 @@  arm*-*-netbsdelf*)
 	tmake_file="${tmake_file} arm/t-arm"
 	target_cpu_cname="strongarm"
 	;;
-arm*-*-linux-*)			# ARM GNU/Linux with ELF
+arm*-*-linux-* | arm*-*-uclinuxfdpiceabi)			# ARM GNU/Linux with ELF
 	tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
 	extra_options="${extra_options} linux-android.opt"
 	case $target in
diff --git a/libatomic/configure b/libatomic/configure
index e7076a0..10b0287 100755
--- a/libatomic/configure
+++ b/libatomic/configure
@@ -6055,7 +6055,7 @@  irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -8540,7 +8540,7 @@  $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -9135,7 +9135,7 @@  _LT_EOF
       archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
       tmp_diet=no
       if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
@@ -10666,7 +10666,7 @@  linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
index ecbb7d3..38e77ce 100644
--- a/libatomic/configure.tgt
+++ b/libatomic/configure.tgt
@@ -124,7 +124,7 @@  case "${target}" in
 	config_path="${config_path} linux/aarch64 posix"
 	;;
 
-  arm*-*-linux*)
+  arm*-*-linux* | arm*-*-uclinux*)
 	# OS support for atomic primitives.
 	config_path="${config_path} linux/arm posix"
 	;;
diff --git a/libgcc/config.host b/libgcc/config.host
index 91abc84..facca2a 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -245,7 +245,7 @@  case ${host} in
   tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-fuchsia"
   extra_parts="crtbegin.o crtend.o"
   ;;
-*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
+*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi)
   tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
   extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
   if test x$enable_vtable_verify = xyes; then
@@ -435,7 +435,7 @@  arm*-*-fuchsia*)
 arm*-*-netbsdelf*)
 	tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover"
 	;;
-arm*-*-linux*)			# ARM GNU/Linux with ELF
+arm*-*-linux* | arm*-*-uclinuxfdpiceabi)			# ARM GNU/Linux with ELF
 	tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm"
 	tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"
 	tm_file="$tm_file arm/bpabi-lib.h"
diff --git a/libitm/configure b/libitm/configure
index fb742d7..7b4c749 100644
--- a/libitm/configure
+++ b/libitm/configure
@@ -6731,7 +6731,7 @@  irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -9217,7 +9217,7 @@  $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -9812,7 +9812,7 @@  _LT_EOF
       archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
       tmp_diet=no
       if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
@@ -11343,7 +11343,7 @@  linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -13244,7 +13244,7 @@  if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
         inherit_rpath_CXX=yes
         ;;
 
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
         case $cc_basename in
           KCC*)
 	    # Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -13831,7 +13831,7 @@  interix[3-9]*)
   postdeps_CXX=
   ;;
 
-linux*)
+linux* | uclinux*)
   case `$CC -V 2>&1 | sed 5q` in
   *Sun\ C*)
     # Sun C++ 5.9
@@ -14082,7 +14082,7 @@  $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 	    ;;
 	esac
 	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)
 	case $cc_basename in
 	  KCC*)
 	    # KAI C++ Compiler
@@ -15003,7 +15003,7 @@  linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -16468,7 +16468,7 @@  fi
 
 
 case "$target" in
-  *-linux*)
+  *-linux* | *-uclinux*)
     case "$enable_linux_futex" in
       default)
 	# If headers don't have gettid/futex syscalls definition, then
@@ -16591,7 +16591,7 @@  _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   chktls_save_LDFLAGS="$LDFLAGS"
 	  	  	  case $host in
-	    *-*-linux*)
+	    *-*-linux* | -*-uclinux*)
 	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
 	      ;;
 	  esac
diff --git a/libitm/configure.tgt b/libitm/configure.tgt
index 4c0b602..eea865d 100644
--- a/libitm/configure.tgt
+++ b/libitm/configure.tgt
@@ -127,7 +127,7 @@  config_path="$ARCH posix generic"
 
 # Other system configury
 case "${target}" in
-  *-*-linux*)
+  *-*-linux* | *-*-uclinux*)
 	if test "$enable_linux_futex" = yes; then
 	  config_path="linux/$ARCH linux $config_path"
 	fi
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 84258d8..cb0fdc5 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -1404,7 +1404,7 @@  AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [
         ac_has_nanosleep=yes
         ac_has_sched_yield=yes
         ;;
-      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
+      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)
         AC_MSG_CHECKING([for at least GNU libc 2.17])
         AC_TRY_COMPILE(
           [#include <features.h>],
@@ -1526,7 +1526,7 @@  AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [
 
   if test x"$ac_has_clock_monotonic" != x"yes"; then
     case ${target_os} in
-      linux*)
+      linux* | uclinux*)
 	AC_MSG_CHECKING([for clock_gettime syscall])
 	AC_TRY_COMPILE(
 	  [#include <unistd.h>
@@ -2415,7 +2415,7 @@  AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
   # Default to "generic".
   if test $enable_clocale_flag = auto; then
     case ${target_os} in
-      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)
 	enable_clocale_flag=gnu
 	;;
       darwin*)
@@ -2661,7 +2661,7 @@  AC_DEFUN([GLIBCXX_ENABLE_ALLOCATOR], [
   # Default to "new".
   if test $enable_libstdcxx_allocator_flag = auto; then
     case ${target_os} in
-      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)
 	enable_libstdcxx_allocator_flag=new
 	;;
       *)
@@ -4361,7 +4361,7 @@  AC_DEFUN([GLIBCXX_ENABLE_FILESYSTEM_TS], [
       freebsd*|netbsd*|openbsd*|dragonfly*|darwin*)
         enable_libstdcxx_filesystem_ts=yes
         ;;
-      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
+      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)
         enable_libstdcxx_filesystem_ts=yes
         ;;
       rtems*)
@@ -4543,7 +4543,7 @@  dnl
     AC_MSG_CHECKING([for sendfile that can copy files])
     AC_CACHE_VAL(glibcxx_cv_sendfile, [dnl
       case "${target_os}" in
-        gnu* | linux* | solaris*)
+        gnu* | linux* | solaris* | uclinux*)
           GCC_TRY_COMPILE_OR_LINK(
             [#include <sys/sendfile.h>],
             [sendfile(1, 2, (off_t*)0, sizeof 1);],
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 7d134a0..91873b8 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -6652,7 +6652,7 @@  irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -9003,7 +9003,7 @@  $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -9598,7 +9598,7 @@  _LT_EOF
       archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
       tmp_diet=no
       if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
@@ -11138,7 +11138,7 @@  linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -13063,7 +13063,7 @@  if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
         inherit_rpath_CXX=yes
         ;;
 
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
         case $cc_basename in
           KCC*)
 	    # Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -13650,7 +13650,7 @@  interix[3-9]*)
   postdeps_CXX=
   ;;
 
-linux*)
+linux* | uclinux*)
   case `$CC -V 2>&1 | sed 5q` in
   *Sun\ C*)
     # Sun C++ 5.9
@@ -13901,7 +13901,7 @@  $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 	    ;;
 	esac
 	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)
 	case $cc_basename in
 	  KCC*)
 	    # KAI C++ Compiler
@@ -14822,7 +14822,7 @@  linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -16143,7 +16143,7 @@  fi
   # Default to "generic".
   if test $enable_clocale_flag = auto; then
     case ${target_os} in
-      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)
 	enable_clocale_flag=gnu
 	;;
       darwin*)
@@ -16560,7 +16560,7 @@  fi
   # Default to "new".
   if test $enable_libstdcxx_allocator_flag = auto; then
     case ${target_os} in
-      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)
 	enable_libstdcxx_allocator_flag=new
 	;;
       *)
@@ -20834,7 +20834,7 @@  ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
         ac_has_nanosleep=yes
         ac_has_sched_yield=yes
         ;;
-      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
+      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for at least GNU libc 2.17" >&5
 $as_echo_n "checking for at least GNU libc 2.17... " >&6; }
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -21334,7 +21334,7 @@  $as_echo "$ac_has_nanosleep" >&6; }
 
   if test x"$ac_has_clock_monotonic" != x"yes"; then
     case ${target_os} in
-      linux*)
+      linux* | uclinux*)
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime syscall" >&5
 $as_echo_n "checking for clock_gettime syscall... " >&6; }
 	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -28220,7 +28220,7 @@  _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   chktls_save_LDFLAGS="$LDFLAGS"
 	  	  	  case $host in
-	    *-*-linux*)
+	    *-*-linux* | -*-uclinux*)
 	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
 	      ;;
 	  esac
@@ -53895,7 +53895,7 @@  _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   chktls_save_LDFLAGS="$LDFLAGS"
 	  	  	  case $host in
-	    *-*-linux*)
+	    *-*-linux* | -*-uclinux*)
 	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
 	      ;;
 	  esac
@@ -60082,7 +60082,7 @@  _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   chktls_save_LDFLAGS="$LDFLAGS"
 	  	  	  case $host in
-	    *-*-linux*)
+	    *-*-linux* | -*-uclinux*)
 	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
 	      ;;
 	  esac
@@ -78725,7 +78725,7 @@  fi
 
 
 case "$target" in
-  *-linux*)
+  *-linux* | *-uclinux*)
     case "$enable_linux_futex" in
       default)
 	# If headers don't have gettid/futex syscalls definition, then
@@ -80354,7 +80354,7 @@  $as_echo_n "checking whether to build Filesystem TS support... " >&6; }
       freebsd*|netbsd*|openbsd*|dragonfly*|darwin*)
         enable_libstdcxx_filesystem_ts=yes
         ;;
-      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
+      gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*)
         enable_libstdcxx_filesystem_ts=yes
         ;;
       rtems*)
@@ -80906,7 +80906,7 @@  $as_echo_n "checking for sendfile that can copy files... " >&6; }
   $as_echo_n "(cached) " >&6
 else
         case "${target_os}" in
-        gnu* | linux* | solaris*)
+        gnu* | linux* | solaris* | uclinux*)
           if test x$gcc_no_link = xyes; then
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
index f2ff129..ae156fc 100644
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -264,7 +264,7 @@  case "${host_os}" in
   linux-musl*)
     os_include_dir="os/generic"
     ;;
-  gnu* | linux* | kfreebsd*-gnu)
+  gnu* | linux* | kfreebsd*-gnu | uclinux*)
     if [ "$uclibc" = "yes" ]; then
       os_include_dir="os/uclibc"
     elif [ "$bionic" = "yes" ]; then
@@ -327,7 +327,7 @@  esac
 # Set any OS-dependent and CPU-dependent bits.
 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
 case "${host}" in
-  *-*-linux*)
+  *-*-linux* | *-*-uclinux*)
     case "${host_cpu}" in
       i[567]86)
         abi_baseline_pair=i486-linux-gnu
@@ -361,7 +361,7 @@  case "${host}" in
         fi
     esac
     case "${host}" in
-      arm*-*-linux-*)
+      arm*-*-linux-* | arm*-*-uclinuxfdpiceabi)
 	port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
 	;;
     esac
diff --git a/libtool.m4 b/libtool.m4
index 8966762..afd3f05 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -2449,7 +2449,7 @@  linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -3089,7 +3089,7 @@  irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -3734,7 +3734,7 @@  m4_if([$1], [CXX], [
 	    ;;
 	esac
 	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)
 	case $cc_basename in
 	  KCC*)
 	    # KAI C++ Compiler
@@ -4032,7 +4032,7 @@  m4_if([$1], [CXX], [
       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -4449,7 +4449,7 @@  _LT_EOF
       _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
       tmp_diet=no
       if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
@@ -5946,7 +5946,7 @@  if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(inherit_rpath, $1)=yes
         ;;
 
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
         case $cc_basename in
           KCC*)
 	    # Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -6598,7 +6598,7 @@  interix[[3-9]]*)
   _LT_TAGVAR(postdeps,$1)=
   ;;
 
-linux*)
+linux* | uclinux*)
   case `$CC -V 2>&1 | sed 5q` in
   *Sun\ C*)
     # Sun C++ 5.9