diff mbox

fix PR71721

Message ID 20161202051400.GA14207@waldemar-brodkorb.de
State New
Headers show

Commit Message

Waldemar Brodkorb Dec. 2, 2016, 5:14 a.m. UTC
Hi,

it would be nice if uclinux targets are allowed to enable posix threads.
Together with uClibc-ng/uClibc you can build m68k-nommu toolchain and enable
old Linuxthreads instead of NPTL/TLS. With following change it is possible to build
boost, which checks if gcc is build with threads enabled.

Tested with a simple boost application on qemu-system-m68k emulating a coldfire
board without MMU. Other noMMU targets as cortex-m3/cortex-m4 will benefit from
this change, too.

The patch is used in Buildroot for a while without causing issues.

2016-12-02  Waldemar Brodkorb <wbx@openadk.org>

       gcc/
       * gcc/config.gcc: Enable posix threads.

Comments

Jeff Law Dec. 5, 2016, 5:48 p.m. UTC | #1
On 12/01/2016 10:14 PM, Waldemar Brodkorb wrote:
> Hi,
>
> it would be nice if uclinux targets are allowed to enable posix threads.
> Together with uClibc-ng/uClibc you can build m68k-nommu toolchain and enable
> old Linuxthreads instead of NPTL/TLS. With following change it is possible to build
> boost, which checks if gcc is build with threads enabled.
>
> Tested with a simple boost application on qemu-system-m68k emulating a coldfire
> board without MMU. Other noMMU targets as cortex-m3/cortex-m4 will benefit from
> this change, too.
>
> The patch is used in Buildroot for a while without causing issues.
>
> 2016-12-02  Waldemar Brodkorb <wbx@openadk.org>
>
>        gcc/
>        * gcc/config.gcc: Enable posix threads.
THanks.  Installed.

jeff
diff mbox

Patch

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 98267d8..6a95009 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -831,6 +831,9 @@  case ${target} in
 *-*-uclinux*)
   extra_options="$extra_options gnu-user.opt"
   use_gcc_stdint=wrap
+  case ${enable_threads} in
+    "" | yes | posix) thread_file='posix' ;;
+  esac
   tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC"
   ;;
 *-*-rdos*)