[haiku-bugs] Re: [Haiku] #10272: Incorporation of GCC 4.8

  • From: "korli" <trac@xxxxxxxxxxxx>
  • Date: Thu, 30 Jan 2014 22:07:53 -0000

#10272: Incorporation of GCC 4.8
----------------------------+----------------------------
   Reporter:  korli         |      Owner:  nobody
       Type:  enhancement   |     Status:  assigned
   Priority:  normal        |  Milestone:  Unscheduled
  Component:  Build System  |    Version:  R1/Development
 Resolution:                |   Keywords:
 Blocked By:                |   Blocking:
Has a Patch:  1             |   Platform:  All
----------------------------+----------------------------

Comment (by korli):

 Adrien, please try the following. It can be applied as is when it works
 for you.
 {{{
 diff --git a/build/scripts/build_cross_tools_gcc4
 b/build/scripts/build_cross_tools_gcc4
 index 346c9da..af370ef 100755
 --- a/build/scripts/build_cross_tools_gcc4
 +++ b/build/scripts/build_cross_tools_gcc4
 @@ -199,7 +199,7 @@ CFLAGS="-O2 -pipe" CXXFLAGS="-O2"
 "$gccSourceDir/configure" \
         --prefix="$installDir" $buildHostSpec --target=$haikuMachine \
         --disable-nls --disable-shared --with-system-zlib \
         --enable-languages=c,c++ --enable-lto --enable-frame-pointer \
 -       --with-sysroot="$sysrootDir" \
 +       --with-sysroot="$sysrootDir" --enable-threads=posix \
         $gccConfigureArgs \
         || exit 1
 }}}

 I've tested in cross-compilation: it builds OK and compiled successfully
 the following sample (with -std=c++11).
 {{{
 #include <iostream>
 #include <thread>
 #include <mutex>

 std::once_flag flag;

 void do_once()
 {
     std::call_once(flag, [](){ std::cout << "Called once" << std::endl;
 });
 }

 int main()
 {
     std::thread t1(do_once);
     std::thread t2(do_once);
     std::thread t3(do_once);
     std::thread t4(do_once);

     t1.join();
     t2.join();
     t3.join();
     t4.join();
 }
 }}}

--
Ticket URL: <https://dev.haiku-os.org/ticket/10272#comment:37>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: