How to compile a port with GCC instead of clang

Roland Smith rsmith at xs4all.nl
Sun Dec 8 22:52:17 UTC 2013


On Mon, Dec 09, 2013 at 08:46:01PM +0000, Peter Harrison wrote:
> Sunday,  8 December 2013 at 12:47:06 +0100, Roland Smith said:
> > On Sun, Dec 08, 2013 at 10:54:55AM +0000, Peter Harrison wrote:
> > > Hello list.
> > > 
> > > How can I compile www/chromium with GCC instead of clang?
> > > 
> > > If I compile it with clang I end up with a broken binary that won't render
> > > pages properly. If I compile it with gcc it works flawlessly.
> > > 
> > > But the knob to choose gcc has been removed in the recent updates. So now I
> > > have a broken chromium. How can I compile it with gcc instead?
> > 
> > Add the following to your /etc/make.conf:
> > 
> > .if ${.CURDIR:M*/www/chromium}
> > USE_GCC?=yes
> > .endif
> > 
> > See /usr/ports/Mk/bsd.gcc.mk for the possible values of USE_GCC.
> 
> Thanks Roland.
> 
> That worked, but sadly seems to have just uncovered why the gcc option was removed. Built with clang my chromium still doesn't function properly. Attempting to build with gcc produces the error below.
> 
> Anyone got any idea either how to build a functioning chromium with clang, or how to successfully build it with gcc?

You would have to remove the offending options from the chromium build system.
Grep will tell you where to find them, I guess.

I'm not familiar with ninja or gyp, but it seems like it is still using clang options
when using gcc. Maybe you need to add something to GYP_DEFINES in the port
Makefile, like use_gcc=1? There doesn't seem to be anything related in
third_party/lzma_sdk/lzma_sdk.gyp

> Attempting to build with gcc I get:
> 
> [2/12492] CC obj/third_party/lzma_sdk/lzma_sdk.7zAlloc.o
> FAILED: gcc46 -MMD -MF obj/third_party/lzma_sdk/lzma_sdk.7zAlloc.o.d -DANGLE_DX11 -D_FILE_OFFSET_BITS=64 -DNO_TCMALLOC -DDISABLE_NACL -DCHROMIUM_BUILD -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_NSS=1 -DUSE_X11=1 -DENABLE_ONE_CLICK_SIGNIN -DGTK_DISABLE_SINGLE_INCLUDES=1 -DUSE_XI2_MT=2 -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DUSE_PROPRIETARY_CODECS -DENABLE_CONFIGURATION_POLICY -DENABLE_INPUT_SPEECH -DENABLE_NOTIFICATIONS -DENABLE_GPU=1 -DENABLE_EGLIMAGE=1 -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGIN_INSTALLATION=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_BACKGROUND=1 -DENABLE_AUTOMATION=1 -DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=1 -DENABLE_FULL_PRINTING=1 -DENABLE_PRINTING=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_MANAGED_USERS=1 -D_7ZIP_ST -D_LZMA_PROB32 -DNDEBUG -DOFFICIAL_BUILD -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../../third_party/lzma_sdk -fstack-protector --param=ssp-buffer-size=4  -pthread -fno-exceptions -fno-strict-aliasing -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wheader-hygiene -Wno-char-subscripts -Wno-unused-function -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-reserved-user-defined-literal -Wno-deprecated-register -momit-leaf-frame-pointer -fcolor-diagnostics -Wno-format -m32 -mmmx -O2 -fdata-sections -ffunction-sections -fno-unwind-tables -fno-asynchronous-unwind-tables -O2 -pipe -fno-stack-protector -Wno-unknown-warning-option -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing  -c ../../third_party/lzma_sdk/7zAlloc.c -o obj/third_party/lzma_sdk/lzma_sdk.7zAlloc.o
> cc1: error: unrecognized command line option '-Wheader-hygiene'
> cc1: error: unrecognized command line option '-Wstring-conversion'
> cc1: error: unrecognized command line option '-fcolor-diagnostics'
> cc1: warning: unrecognized command line option "-Wno-unknown-warning-option" [enabled by default]
> cc1: warning: unrecognized command line option "-Wno-deprecated-register" [enabled by default]
> cc1: warning: unrecognized command line option "-Wno-reserved-user-defined-literal" [enabled by default]
> cc1: warning: unrecognized command line option "-Wno-c++11-narrowing" [enabled by default]
> cc1: warning: unrecognized command line option "-Wno-covered-switch-default" [enabled by default]
> ninja: build stopped: subcommand failed.
> *** [do-build] Error code 1
> 
> Stop in /usr/ports/www/chromium.
> *** [build] Error code 1
> 
> 
> Many thanks,
> 
> 
> 
> 
> Peter.
> 
> 
> 
> > 
> > 
> > Roland
> > -- 
> > R.F.Smith                                   http://rsmith.home.xs4all.nl/
> > [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
> > pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)
> 

-- 
R.F.Smith                                   http://rsmith.home.xs4all.nl/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20131208/1d6d5f6f/attachment.sig>


More information about the freebsd-questions mailing list