How to build chromium-browser by dpkg-buildpackage?

Asked by Toshi

Can anyone tell me how to build chromium-browser(i386) from source?
I tried but it failed. Here's my docker file.

--
FROM i386/ubuntu:16.04
MAINTAINER Toshiomi Moriki <email address hidden>
ENTRYPOINT ["/usr/bin/linux32", "--"]
RUN apt-get update
RUN apt-get -y build-dep chromium-browser
RUN apt-get source chromium-browser
RUN ln -s /usr/include/asm-generic /usr/include/asm
WORKDIR /chromium-browser-63.0.3239.84
RUN dpkg-buildpackage -B -uc -ai386 --target-arch i386

I got these errors. Why does it build x86-64 binaries??
--
[10776/32118] ../../../usr/bin/clang++-4.0 -MMD -MF clang_x64/obj/base/base_static/base_switches.o.d -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DOFFICIAL_BUILD -DCHROMIUM_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DCR_CLANG_REVISION=\"313786-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../.. -Iclang_x64/gen -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -B../../third_party/binutils/Linux_x64/Release/bin -pthread -fcolor-diagnostics -no-canonical-prefixes -m64 -march=x86-64 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-user-defined-warnings -fomit-frame-pointer -g1 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -O2 -fno-ident -fdata-sections -ffunction-sections -std=gnu++14 -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include -fno-exceptions -fvisibility-inlines-hidden -c ../../base/base_switches.cc -o clang_x64/obj/base/base_static/base_switches.o
[10777/32118] touch obj/v8/v8_libsampler.stamp
[10778/32118] touch clang_x64/obj/base/allocator/allocator.stamp
[10779/32118] python ../../build/write_buildflag_header.py --output base/allocator/features.h --rulename //base/allocator:features --gen-dir clang_x64/gen --definitions __base_allocator_features___build_toolchain_linux_clang_x64__rule.rsp
FAILED: ../../../usr/bin/clang++-4.0 -MMD -MF clang_x64/obj/base/base_static/base_switches.o.d -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DOFFICIAL_BUILD -DCHROMIUM_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DCR_CLANG_REVISION=\"313786-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../.. -Iclang_x64/gen -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -B../../third_party/binutils/Linux_x64/Release/bin -pthread -fcolor-diagnostics -no-canonical-prefixes -m64 -march=x86-64 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-user-defined-warnings -fomit-frame-pointer -g1 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -O2 -fno-ident -fdata-sections -ffunction-sections -std=gnu++14 -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include -fno-exceptions -fvisibility-inlines-hidden -c ../../base/base_switches.cc -o clang_x64/obj/base/base_static/base_switches.o
In file included from ../../base/base_switches.cc:5:
In file included from ../../base/base_switches.h:10:
In file included from ../../build/build_config.h:45:
In file included from /usr/include/unistd.h:25:
/usr/include/features.h:367:12: fatal error: 'sys/cdefs.h' file not found
# include <sys/cdefs.h>
           ^~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
debian/rules:203: recipe for target 'override_dh_auto_build' failed
make[1]: Leaving directory '/chromium-browser-63.0.3239.84'
debian/rules:163: recipe for target 'build-arch' failed

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu chromium-browser Edit question
Assignee:
No assignee Edit question
Solved by:
Toshi
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

sudo add-apt-repository ppa:chromium-team/stable
sudo apt-get update
sudo apt-get install chromium-browser

will give you version 63 for 32bit Xenial.

https://launchpad.net/~chromium-team/+archive/ubuntu/stable?field.series_filter=xenial

Revision history for this message
Toshi (toshiomi-moriki) said :
#2

Thanks Andrew,
but I need to build a custom binary for my old laptop.

Can you anyone tell me the way how to build it from source?

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Are you trying to build on the target system, or are you doing cross-compilation on a 64bit system for 32bit?

You could try using a build chroot, see e.g.
https://help.ubuntu.com/community/BasicChroot
https://help.ubuntu.com/community/DebootstrapChroot
https://wiki.ubuntu.com/SimpleSbuild
https://wiki.ubuntu.com/CrossBuilding

Revision history for this message
Toshi (toshiomi-moriki) said :
#4

Thanks. I’ll try it on the native one(i386).