# building chromium fails



## Alain De Vos (Apr 19, 2020)

Error : 

```
[4662/38744] c++ -MMD -MF obj/third_party/angle/src/libANGLE/renderer/vulkan/angle_vulkan_backend/BufferVk.o.d -DANGLE_VK_LAYERS_DIR=\"angledata\" -DANGLE_VK_MOCK_ICD_JSON=\"angledata/VkICD_mock_icd.json\" -DANGLE_VK_SWIFTSHADER_ICD_JSON=\"./vk_swiftshader_icd.json\" -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DOFFICIAL_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -DCR_CLANG_REVISION=\"n340759-eaabaf7e-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DANGLE_IS_64_BIT_CPU -DANGLE_ENABLE_VULKAN -DANGLE_ENABLE_SWIFTSHADER -DANGLE_USE_CUSTOM_VULKAN_CMD_BUFFERS=1 -DLIBANGLE_IMPLEMENTATION -DANGLE_USE_X11 -DVK_USE_PLATFORM_XCB_KHR -DANGLE_ENABLE_OPENGL -DANGLE_ENABLE_OPENGL_NULL -DANGLE_ENABLE_NULL -DANGLE_ENABLE_VULKAN -DANGLE_ENABLE_SWIFTSHADER -DANGLE_USE_CUSTOM_VULKAN_CMD_BUFFERS=1 -I../../third_party/angle/include -I../../third_party/angle/src -I../../third_party/angle/src/common/third_party/base -Igen/angle -I../../third_party/angle/include -I../../third_party/angle/src/third_party/volk -I../../third_party/angle/third_party/vulkan-headers/src/include -I../../third_party/angle/include -I../../third_party/angle/src -I../../third_party/angle/include -I../../third_party/angle/src -I../../third_party/SPIRV-Tools/src/include -fprofile-sample-use=../../chrome/android/profiles/afdo.prof -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -m64 -march=x86-64 -no-canonical-prefixes -Wall -Wextra -Wimplicit-fallthrough -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -Wglobal-constructors -Wconditional-uninitialized -Wextra-semi-stmt -Wfloat-conversion -Winconsistent-missing-destructor-override -Wmissing-field-initializers -Wnon-virtual-dtor -Wredundant-parens -Wshadow-field -Wtautological-type-limit-compare -Wundefined-reinterpret-cast -Wunneeded-internal-declaration -Wparentheses -Wrange-loop-analysis -Wstrict-prototypes -Wunreachable-code -Wshorten-64-to-32 -Xclang -mllvm -Xclang --enable-global-merge=false -std=c++14 -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -O2 -pipe -O2 -pipe -march=ivybridge -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -pipe  -isystem /usr/local/include  -c ../../third_party/angle/src/libANGLE/renderer/vulkan/BufferVk.cpp -o obj/third_party/angle/src/libANGLE/renderer/vulkan/angle_vulkan_backend/BufferVk.o
FAILED: obj/third_party/angle/src/libANGLE/renderer/vulkan/angle_vulkan_backend/BufferVk.o 
c++ -MMD -MF obj/third_party/angle/src/libANGLE/renderer/vulkan/angle_vulkan_backend/BufferVk.o.d -DANGLE_VK_LAYERS_DIR=\"angledata\" -DANGLE_VK_MOCK_ICD_JSON=\"angledata/VkICD_mock_icd.json\" -DANGLE_VK_SWIFTSHADER_ICD_JSON=\"./vk_swiftshader_icd.json\" -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DOFFICIAL_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -DCR_CLANG_REVISION=\"n340759-eaabaf7e-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DANGLE_IS_64_BIT_CPU -DANGLE_ENABLE_VULKAN -DANGLE_ENABLE_SWIFTSHADER -DANGLE_USE_CUSTOM_VULKAN_CMD_BUFFERS=1 -DLIBANGLE_IMPLEMENTATION -DANGLE_USE_X11 -DVK_USE_PLATFORM_XCB_KHR -DANGLE_ENABLE_OPENGL -DANGLE_ENABLE_OPENGL_NULL -DANGLE_ENABLE_NULL -DANGLE_ENABLE_VULKAN -DANGLE_ENABLE_SWIFTSHADER -DANGLE_USE_CUSTOM_VULKAN_CMD_BUFFERS=1 -I../../third_party/angle/include -I../../third_party/angle/src -I../../third_party/angle/src/common/third_party/base -Igen/angle -I../../third_party/angle/include -I../../third_party/angle/src/third_party/volk -I../../third_party/angle/third_party/vulkan-headers/src/include -I../../third_party/angle/include -I../../third_party/angle/src -I../../third_party/angle/include -I../../third_party/angle/src -I../../third_party/SPIRV-Tools/src/include -fprofile-sample-use=../../chrome/android/profiles/afdo.prof -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -m64 -march=x86-64 -no-canonical-prefixes -Wall -Wextra -Wimplicit-fallthrough -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -Wglobal-constructors -Wconditional-uninitialized -Wextra-semi-stmt -Wfloat-conversion -Winconsistent-missing-destructor-override -Wmissing-field-initializers -Wnon-virtual-dtor -Wredundant-parens -Wshadow-field -Wtautological-type-limit-compare -Wundefined-reinterpret-cast -Wunneeded-internal-declaration -Wparentheses -Wrange-loop-analysis -Wstrict-prototypes -Wunreachable-code -Wshorten-64-to-32 -Xclang -mllvm -Xclang --enable-global-merge=false -std=c++14 -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -O2 -pipe -O2 -pipe -march=ivybridge -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -pipe  -isystem /usr/local/include  -c ../../third_party/angle/src/libANGLE/renderer/vulkan/BufferVk.cpp -o obj/third_party/angle/src/libANGLE/renderer/vulkan/angle_vulkan_backend/BufferVk.o
clang (LLVM option parsing): Unknown command line argument '--enable-global-merge=false'.  Try: 'clang (LLVM option parsing) -help'
clang (LLVM option parsing): Did you mean '-enable-tail-merge=false'?
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/www/chromium
*** Error code 1

Stop.
make: stopped in /usr/ports/www/chromium

===>>> make build failed for www/chromium
```


----------



## zirias@ (Apr 19, 2020)

Hmm, my poudriere built chromium just fine today, on 12.1-RELEASE. What version are you using?


----------



## Alain De Vos (Apr 20, 2020)

FreeBSD 12.1-RELEASE-p3 r359631


----------



## zirias@ (Apr 20, 2020)

Ok, that's very strange -- my poudriere base jail is still on -p1, but the patchlevel shouldn't influence building packages at all. Looking at my last build log from chromium-81.0.4044.113, that same file was built with the same command-line option `--enable-global-merge=false` without issues:

```
[4888/38758] c++ -MMD -MF obj/third_party/angle/src/libANGLE/renderer/vulkan/angle_vulkan_backend/BufferVk.o.d -DANGLE_VK_LAYERS_DIR=\"angledata\" -DANGLE_VK_MOCK_ICD_JSON=\"angledata/VkICD_mock_icd.json\" -DANGLE_VK_SWIFTSHADER_ICD_JSON=\"./vk_swiftshader_icd.json\" -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DOFFICIAL_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -DCR_CLANG_REVISION=\"n340759-eaabaf7e-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DANGLE_IS_64_BIT_CPU -DANGLE_ENABLE_VULKAN -DANGLE_ENABLE_SWIFTSHADER -DANGLE_USE_CUSTOM_VULKAN_CMD_BUFFERS=1 -DLIBANGLE_IMPLEMENTATION -DANGLE_USE_X11 -DVK_USE_PLATFORM_XCB_KHR -DANGLE_ENABLE_OPENGL -DANGLE_ENABLE_OPENGL_NULL -DANGLE_ENABLE_NULL -DANGLE_ENABLE_VULKAN -DANGLE_ENABLE_SWIFTSHADER -DANGLE_USE_CUSTOM_VULKAN_CMD_BUFFERS=1 -I../../third_party/angle/include -I../../third_party/angle/src -I../../third_party/angle/src/common/third_party/base -Igen/angle -I../../third_party/angle/include -I../../third_party/angle/src/third_party/volk -I../../third_party/angle/third_party/vulkan-headers/src/include -I../../third_party/angle/include -I../../third_party/angle/src -I../../third_party/angle/include -I../../third_party/angle/src -I../../third_party/SPIRV-Tools/src/include -fprofile-sample-use=../../chrome/android/profiles/afdo.prof -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -m64 -march=x86-64 -no-canonical-prefixes -Wall -Wextra -Wimplicit-fallthrough -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -Wglobal-constructors -Wconditional-uninitialized -Wextra-semi-stmt -Wfloat-conversion -Winconsistent-missing-destructor-override -Wmissing-field-initializers -Wnon-virtual-dtor -Wredundant-parens -Wshadow-field -Wtautological-type-limit-compare -Wundefined-reinterpret-cast -Wunneeded-internal-declaration -Wparentheses -Wrange-loop-analysis -Wstrict-prototypes -Wunreachable-code -Wshorten-64-to-32 -Xclang -mllvm -Xclang --enable-global-merge=false -std=c++14 -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -c ../../third_party/angle/src/libANGLE/renderer/vulkan/BufferVk.cpp -o obj/third_party/angle/src/libANGLE/renderer/vulkan/angle_vulkan_backend/BufferVk.o
```

So, what's your `c++`? Is it /usr/bin/c++ from base?


----------



## Alain De Vos (Apr 20, 2020)

c++ is the base one,
#c++ -v
FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
Target: x86_64-unknown-freebsd12.1
Thread model: posix
InstalledDir: /usr/bin


----------



## SirDice (Apr 20, 2020)

Alain De Vos said:


> c++ is the base one,


Is there anything in /etc/make.conf?


----------



## Alain De Vos (Apr 20, 2020)

Same error is produced with an empty make.conf. 
I'll rebuild world to check if it remains.


----------



## puretone (Apr 21, 2020)

Same here on 12.1-STABLE & 


```
FreeBSD clang version 9.0.1 (git@github.com:llvm/llvm-project.git c1a0a213378a458fbea1a5c77b315c7dce08fd05) (based on LLVM 9.0.1)
Target: x86_64-unknown-freebsd12.1
Thread model: posix
InstalledDir: /usr/bin
```

From line: [4799/38655] 

```
FAILED: obj/third_party/angle/src/libANGLE/renderer/vulkan/angle_vulkan_backend/BufferVk.o
```

Snippet: 
	
	



```
c++ -MMD -MF obj/third_party/angle/src/libANGLE/renderer/vulkan/angle_vulkan_backend/BufferVk.o.d [/CMD]    [snip-snip-snip] [CMD]   -c ../../third_party/angle/src/libANGLE/renderer/vulkan/BufferVk.cpp -o obj/third_party/angle/src/libANGLE/renderer/vulkan/angle_vulkan_backend/BufferVk.o
clang (LLVM option parsing): Unknown command line argument '--enable-global-merge=false'.  Try: 'clang (LLVM option parsing) --help'
clang (LLVM option parsing): Did you mean '  --enable-tail-merge=false'?
```

I'm probably blurting out nonsense here, but why are we screwing around with what appears to be Vulkan when we can have peace & tranquility with WebGL?


----------



## shkhln (Apr 21, 2020)

__





						245610 – www/chromium: build fail
					






					bugs.freebsd.org
				






puretone said:


> but why are we screwing around with what appears to be Vulkan when we can have peace & tranquility with WebGL?



ANGLE is a translation layer: WebGL in, Vulkan out.


----------



## zirias@ (Apr 21, 2020)

Looking at the patch in this PR, it removes the flag in question here. Just out of curiosity, can someone explain why the build works fine for me on the very same base, which should have an identical clang?


----------



## Alain De Vos (Apr 21, 2020)

Noob question,
How do I apply this patch ?




__





						Attachment 213494 Details for Bug 245610   – build patch
					






					bugs.freebsd.org


----------



## SirDice (Apr 21, 2020)

This particular patch file should be placed in the port's files/ directory, that's what the Index at the top is referring to:  `Index: www/chromium/files/patch-third__party_angle_src_third__party_volk_BUILD.gn`


----------



## Alain De Vos (Apr 21, 2020)

So I run "make extract",
I put the contents of the patch into mypatch.patch which I'll put into files/
In the files/ directory  i  run "path < mypatch.patch"
Then I run "make patch" and "make" ?


----------



## SirDice (Apr 21, 2020)

No, the files/patch-* files are automatically applied during the `make patch` fase. There's no need to do anything special, it's all part of the regular build process.

The patch-* files have specific names, this one should be called patch-third__party_angle_src_third__party_volk_BUILD.gn. Which means it's a patch for third_party/angle/src/third_party/volk/BUILD.gn.



> When creating names for patch files, replace each underscore (_) with two underscores (__) and each slash (/) with one underscore (_). For example, to patch a file named src/freeglut_joystick.c, name the corresponding patch patch-src_freeglut__joystick.c.











						Chapter 4. Slow Porting
					

Description about creating a FreeBSD Port when the program need some modifications




					www.freebsd.org


----------



## Alain De Vos (Apr 21, 2020)

Applying the patch it is passing now.
It took only to 1day to compile.


----------



## Bdee (May 9, 2020)

I try to build, and it failed with same error. Then I applied the patch and it not worked. All  on 81.0.4044.92;  113 ; 129; and now on 138.  Before 4044.92 it was buildt without error. c++ is the base one: 9.0.1(in april) and 10.0.0 at now. 12.1 -STABLE. In the conf only two diff ( CUPS=off, SNDIO=on).  /etc/make.conf   is clean. I don't understand why the build works fine for somebody, why work the patch for somebody, and why not for me on the very same base.


----------



## Lincas (May 19, 2020)

Bdee said:


> I try to build, and it failed with same error. Then I applied the patch and it not worked. All  on 81.0.4044.92;  113 ; 129; and now on 138.  Before 4044.92 it was buildt without error. c++ is the base one: 9.0.1(in april) and 10.0.0 at now. 12.1 -STABLE. In the conf only two diff ( CUPS=off, SNDIO=on).  /etc/make.conf   is clean. I don't understand why the build works fine for somebody, why work the patch for somebody, and why not for me on the very same base.




hi, for me helped by removing WITHOUT_LLVM_TARGET_ALL= in /etc/src.conf and rebuilding world


----------



## Bdee (May 20, 2020)

Lincas said:


> hi, for me helped by removing WITHOUT_LLVM_TARGET_ALL= in /etc/src.conf and rebuilding world


I will try tomorrow and reply.


----------



## Bdee (May 21, 2020)

Lincas said:


> hi, for me helped by removing WITHOUT_LLVM_TARGET_ALL= in /etc/src.conf and rebuilding world


Yes, it works for me too, but  I don't know why.


----------



## Lincas (May 22, 2020)

Bdee said:


> Yes, it works for me too, but  I don't know why.


 Not sure, didn’t tried to understand. Why you after this one?


----------



## Argentum (May 23, 2020)

I have built chromium several times on different machines. Today I have my own build of 'chromium-81.0.4044.138_1'.

Some time ago I had a strange build error.
`find / -name "*.core" -exec rm -f {} \;`
solved the problem.


----------



## Bdee (May 26, 2020)

Lincas said:


> Not sure, didn’t tried to understand. Why you after this one?


If the ball falls up, I like to understand why.


----------



## tOsYZYny (Nov 27, 2020)

Hi - the version of chromium is quite dated in ports ... I tried to bump the version, remove the failing patches (most), but now the build is failing on host_os unsupported.

1. How do I get around the host_os unsupported?  I assume I need to patch a file somewhere that checks whether FreeBSD is supported
2. How do I update the patches, who maintains this?  The list is long, so I hope this process is automated.


Assuming I get it building, what is the process to get it updated in ports for others?


----------



## acheron (Nov 29, 2020)

tOsYZYny said:


> Hi - the version of chromium is quite dated in ports ... I tried to bump the version, remove the failing patches (most), but now the build is failing on host_os unsupported.
> 
> 1. How do I get around the host_os unsupported?  I assume I need to patch a file somewhere that checks whether FreeBSD is supported
> 2. How do I update the patches, who maintains this?  The list is long, so I hope this process is automated.
> ...


1 - The patched you deleted are necessary and should be fixed / ported to the new version.
2 - look at the patches you delete and fix / update them. The process is manual (google don't accept FreeBSD / chromium patches)

Anyway, there are some people working on it: https://github.com/freebsd/chromium they work on the v87 branch currently.


----------



## tOsYZYny (Nov 29, 2020)

Ah okay, cool, I will use that as a reference instead of ports.  If I manage to get it working, then I can open a PR, then that should make its way back into ports.


----------

