3 Replies Latest reply on Apr 26, 2012 11:45 PM by jhshi

    Compile Barrelfish For SCC




      I'm trying to compile Barrelfish for SCC, and I use the cross-compiler located in this directory:



      I'm accessing the datacenter in Wuxi, China, so the path maybe different with the MARC data center. Anyway, this gcc's -v shows these info:


      Configured with: /localdisk/buildenv/crosstool/crosstool-0.42/build/i386-unknown-linux-gnu/gcc-3.4.5-glibc-2.3.6/gcc-3.4.5/configure --target=i386-unknown-linux-gnu --host=i686-host_pc-linux-gnu --prefix=/proj/MCEMU/modules/crosstool/0.42.1/gcc-3.4.5-glibc-2.3.6/i386-unknown-linux-gnu --with-headers=/proj/MCEMU/modules/crosstool/0.42.1/gcc-3.4.5-glibc-2.3.6/i386-unknown-linux-gnu/i386-unknown-linux-gnu/include --with-local-prefix=/proj/MCEMU/modules/crosstool/0.42.1/gcc-3.4.5-glibc-2.3.6/i386-unknown-linux-gnu/i386-unknown-linux-gnu --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long
      Thread model: posix
      gcc version 3.4.5


      When I compile the Barrelfish, a whole bunch of errors bumped up, I've to manually fix a lot of thing that were not mentioned at all in these posts (http://marcbug.scc-dc.com/bugzilla3/show_bug.cgi?id=324



      For example, the gcc-3.4.5 will not recognize the -fno-stack-protector and build-id option, and will not accept binary constants (e.g. 0b111 in the eMAC driver code). But after all this modifications, it still complain that "undefined reference to `__sync_bool_compare_and_swap`", and stop linking. And these __sync_bool_compare_and_swap stuff seems to be added to gcc after 4.1...


      All these compiler errors almost drive me crazy. I was wondering are there any special reasons to choose such an old version of gcc ? More specifically, does the crosscompiler have any source code change for the SCC's P54C core? If not, can I use a new version of gcc and configured the same as the 3.4.5 provided, and use the new gcc to compile Barrelfish ?


      BTW, I saw a few posts in the forum say that they've ported Barrelfish to SCC. So can you give any hints about how to do it? Use what compiler?


      Thanks in advance!


        • 1. Re: Compile Barrelfish For SCC



          have you looked at http://communities.intel.com/message/146497


          Regarding crosscompiler normally you just run crosscompile.sh script to set the environment which uses /opt/i386-unknown-linux-gnu/bin/gcc

          i have attached the script in case.


          Hope this helps.

          • 2. Re: Compile Barrelfish For SCC

            Hello Jinghao,

            Did Nil's suggestion help?

            • 3. Re: Compile Barrelfish For SCC

              Oh, sorry for my late response. Here is the update.


              I found that it's prohibitably impossible to compile Barrelfish using the cross compiler (3.4.5) provided. And it's quite exhausting to fix all the compatibility stuff (e.g. comand line arguement, _builtin_offsetof_, etc, etc).


              Then I tried the system default GCC, which is 4.4.3 with the output of gcc -v is:


              Using built-in specs.
              Target: x86_64-linux-gnu
              Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5.1' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
              Thread model: posix
              gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)


              And it works! No error, no warnings. And then I realized that the provided cross compiler (3.4.5) may just intended to compile RCCE applications.


              But when I tried to boot the compiled image on SCC, I encounted this problem, which I'm still struggle with...