[Firefox] How to compile firefox with Clang for Linux

Hi All,

I am trying to build firefox with clang in Ubuntu 14.04 64bit. There is always configure failed errors problem. I follow compiling firefox with clang on linux. I add “export CC=clang export CXX=clang++” to mozconfig file.

I wonder whether you guys have built firefox with clang in Linux. Could you give me some tips how to build the firefox with clang.

Best Regards,
Pengfei

Hi Pengfei,

I’m pretty sure that some of the Mozilla devs are building Firefox with clang on Linux. You’ll get better (as in firefox-specific) advice at the Mozilla’s IRC channels (https://wiki.mozilla.org/IRC) given that the errors happen during configuration-time.

  • Vasileios

Hi Vasileios,

Thanks for your suggestion. I will go to Mozilla’s IRC channels to ask for help.

My errors are as following:

0:00.84 configure:3537: checking whether the C compiler (/home/sun/project/obfuscator/build/bin/clang -fsanitize=address -Dxmalloc=myxmalloc -fPIC -fsanitize=address) works
0:00.84 configure:3553: /home/sun/project/obfuscator/build/bin/clang -o conftest -fsanitize=address -Dxmalloc=myxmalloc -fPIC -fsanitize=address conftest.c 1>&5
0:00.84 /home/sun/project/mozilla-central/configure: 1: eval: /home/sun/project/obfuscator/build/bin/clang: Permission denied
0:00.84 configure: failed program was:
0:00.84
0:00.84 #line 3548 “configure”
0:00.84 #include “confdefs.h”
0:00.84
0:00.84 main(){return(0);}
0:00.84 configure: error: installation or configuration problem: C compiler cannot create executables.
0:00.84 *** Fix above errors and then restart with
0:00.84 “/usr/bin/make -f client.mk build”
0:00.84 make[2]: *** [configure] Error 1
0:00.84 make[1]: *** [/home/sun/project/mozilla-central/objdir-ff-asan/Makefile] Error 2
0:00.85 make: *** [build] Error 2

Best Regards,
Pengfei

Hi Vasileios,

Thanks for your suggestion. I will go to Mozilla's IRC channels to ask
for help.

My errors are as following:

  0:00.84 /home/sun/project/mozilla-central/configure: 1: eval:
/home/sun/project/obfuscator/build/bin/clang: Permission denied

This ^ should tell you what the problem is.