[FUG-BR] FreeBSD 10 vai substituir o GCC pelo Clang

Paulo Olivier Cavalcanti procavalcanti em gmail.com
Terça Maio 15 08:53:51 BRT 2012


On 15/05/2012 01:08, Luiz Gustavo wrote:
> Em Seg, 2012-05-14 às 16:07 -0300, Paulo Olivier Cavalcanti escreveu:
>> Experimentei compilar o Firefox com clang e deu um monte de erros. Será
>> que configurei o clang errado? Eu segui o tutorial deste site [1], mas
>> pelo visto ele não funciona. Existe outro tutorial melhor? Valeu.
>>
>> [1] http://wiki.freebsd.org/BuildingFreeBSDWithClang
>>
> Basicamente é isso mesmo, eu até fui atualizar o meu firefox, que ainda
> tava rodando uma versão esr para a não esr (versão 12) e compilei com
> clang e foi de boa.
>
> o meu make.conf tem isso:
>
> .if !defined(CC) || ${CC} == "cc"
> CC=clang
> .endif
> .if !defined(CXX) || ${CXX} == "c++"
> CXX=clang++
> .endif
> .if !defined(CPP) || ${CPP} == "cpp"
> CPP=clang -E
> .endif
>
> O que aparece bastante são os "warnings" que é uma coisa normal, já que
> muita coisa em códigos por ai fogem um pouco do padrão e o clang
> sinaliza através de um warning, mas nada que impeça de compilar os
> binarios.
>
> Na curiosidade de ver o Clang em ação e lendo algumas situações hilarias
> que o amigo barbudo não gostaria de ver, fui eu compilar o GCC 4.8 com
> Clang pra ver se ia.. e não é que o bicho compilou o GCC48 com Clang
> direitinho :) kkkkkkk
>
> Um GPLv3 compilado por um BSD
>
> # time portmaster -d lang/gcc48
> ....
> ===>>>  The following actions were performed:
>          Upgrade of gmp-5.0.4 to gmp-5.0.5
>          Installation of devel/patch (patch-2.6.1_1)
>          Upgrade of mpfr-3.1.0_2 to mpfr-3.1.0_3
>          Upgrade of gcc-4.8.0.20120415 to gcc-4.8.0.20120506
>
> 5703.596u 395.092s 57:58.50 175.3%      25518+4258k 9853+40237io 6503pf
> +0w
>
> # clang -v
> clang version 3.0 (tags/RELEASE_30/final)
> Target: amd64-portbld-freebsd8.2
> Thread model: posix
>
> # /usr/local/bin/gcc48 -v
> Using built-in specs.
> COLLECT_GCC=/usr/local/bin/gcc48
> COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc48/gcc/x86_64-portbld-freebsd8.3/4.8.0/lto-wrapper
> Target: x86_64-portbld-freebsd8.3
> Configured with: ./../gcc-4.8-20120506/configure --disable-nls
> --enable-languages=c,c++,objc,fortran --libdir=/usr/local/lib/gcc48
> --libexecdir=/usr/local/libexec/gcc48 --program-suffix=48
> --with-as=/usr/local/bin/as --with-gmp=/usr/local
> --with-gxx-include-dir=/usr/local/lib/gcc48/include/c++/
> --with-ld=/usr/local/bin/ld --with-libiconv-prefix=/usr/local
> --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib
> --disable-libgcj --prefix=/usr/local --mandir=/usr/local/man
> --infodir=/usr/local/info/gcc48 --build=x86_64-portbld-freebsd8.3
> Thread model: posix
> gcc version 4.8.0 20120506 (experimental) (FreeBSD Ports Collection)
>
>
> * Detalhe que usei um FreeBSD 8.3 com clang via ports
O meu /etc/make.conf está assim:

CC=clang
CXX=clang++
CPP=clang-cpp


Os erros que aparecem são os seguintes:


In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction 
set not
       enabled"
#error "MMX instruction set not enabled"
  ^
In file included from 
/usr/ports/www/firefox/work/mozilla-release/xpcom/string/src/nsUTF8UtilsSSE2.cpp:3:
In file included from /usr/include/clang/3.0/emmintrin.h:31:
/usr/include/clang/3.0/xmmintrin.h:417:19: error: unknown type name '__m64'
static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
                   ^
/usr/include/clang/3.0/xmmintrin.h:417:25: error: expected unqualified-id
static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
                         ^
In file included from 
/usr/ports/www/firefox/work/mozilla-release/xpcom/string/src/nsUTF8UtilsSSE2.cpp:3:
/usr/include/clang/3.0/emmintrin.h:42:19: error: unknown type name '__m128d'
static __inline__ __m128d __attribute__((__always_inline__, __nodebug__))
                   ^
/usr/include/clang/3.0/emmintrin.h:42:27: error: expected unqualified-id
static __inline__ __m128d __attribute__((__always_inline__, __nodebug__))
                           ^
In file included from 
/usr/ports/www/firefox/work/mozilla-release/xpcom/string/src/nsUTF8UtilsSSE2.cpp:4:
../../../dist/include/nsUTF8Utils.h:90:10: error: use of undeclared 
identifier
       'UTF8traits'
     if ( UTF8traits::isASCII(c) )
          ^
../../../dist/include/nsUTF8Utils.h:146:10: error: use of undeclared 
identifier
       'UTF8traits'
     if ( UTF8traits::is2byte(c) )
          ^
../../../dist/include/nsUTF8Utils.h:152:15: error: use of undeclared 
identifier
       'UTF8traits'
     else if ( UTF8traits::is3byte(c) )
               ^
../../../dist/include/nsUTF8Utils.h:158:15: error: use of undeclared 
identifier
       'UTF8traits'
     else if ( UTF8traits::is4byte(c) )
               ^
../../../dist/include/nsUTF8Utils.h:164:15: error: use of undeclared 
identifier
       'UTF8traits'
     else if ( UTF8traits::is5byte(c) )
               ^
../../../dist/include/nsUTF8Utils.h:170:15: error: use of undeclared 
identifier
       'UTF8traits'
     else if ( UTF8traits::is6byte(c) )
               ^
../../../dist/include/nsUTF8Utils.h:186:10: error: use of undeclared 
identifier
       'UTF8traits'
     if ( UTF8traits::isInSeq(c) )
          ^../../../dist/include/nsUTF8Utils.h:393:18: error: use of 
undeclared identifier
       'UTF8traits'
             if ( UTF8traits::isASCII(*p) )
                  ^
../../../dist/include/nsUTF8Utils.h:395:23: error: use of undeclared 
identifier
       'UTF8traits'
             else if ( UTF8traits::is2byte(*p) )
                       ^
../../../dist/include/nsUTF8Utils.h:397:23: error: use of undeclared 
identifier
       'UTF8traits'
             else if ( UTF8traits::is3byte(*p) )
                       ^
../../../dist/include/nsUTF8Utils.h:399:23: error: use of undeclared 
identifier
       'UTF8traits'
             else if ( UTF8traits::is4byte(*p) ) {
                       ^
../../../dist/include/nsUTF8Utils.h:442:23: error: use of undeclared 
identifier
       'UTF8traits'
             else if ( UTF8traits::is5byte(*p) )
                       ^
../../../dist/include/nsUTF8Utils.h:444:23: error: use of undeclared 
identifier
       'UTF8traits'
             else if ( UTF8traits::is6byte(*p) )
                       ^
../../../dist/include/nsUTF8Utils.h:686:24: error: no member named
       'supports_sse2' in namespace 'mozilla'
           if (mozilla::supports_sse2())
               ~~~~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
gmake[5]: ** [nsUTF8UtilsSSE2.o] Erro 1
gmake[5]: Saindo do diretório 
`/usr/ports/www/firefox/work/mozilla-release/xpcom/string/src'
gmake[4]: ** [libs] Erro 2
gmake[4]: Saindo do diretório 
`/usr/ports/www/firefox/work/mozilla-release/xpcom/string'
gmake[3]: ** [libs] Erro 2
gmake[3]: Saindo do diretório 
`/usr/ports/www/firefox/work/mozilla-release/xpcom'
gmake[2]: ** [libs_tier_platform] Erro 2
gmake[2]: Saindo do diretório `/usr/ports/www/firefox/work/mozilla-release'
gmake[1]: ** [tier_platform] Erro 2
gmake[1]: Saindo do diretório `/usr/ports/www/firefox/work/mozilla-release'
gmake: ** [default] Erro 2
*** Error code 1



-- 
http://about.me/paulocavalcanti



Mais detalhes sobre a lista de discussão freebsd