hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# gn-native contains the GN binary used to configure Chromium.
# It is not released separately, and each Chromium release is only expected to
# work with the GN version provided with it.
 
require chromium.inc
 
inherit native
 
S = "${WORKDIR}/chromium-${PV}"
 
# bootstrap.py --no_clean hardcodes the build location to out_bootstrap.
# Omitting --no_clean causes the script to create a temporary directory with a
# random name outside the build directory, so we choose the lesser of the two
# evils.
B = "${S}/out_bootstrap"
 
SRC_URI += " \
        file://0001-Pass-no-static-libstdc-to-gen.py.patch \
"
 
# The build system expects the linker to be invoked via the compiler. If we use
# the default value for BUILD_LD, it will fail because it does not recognize
# some of the arguments passed to it.
BUILD_LD = "${CXX}"
 
# Use LLVM's ar rather than binutils'. Depending on the optimizations enabled
# in the build ar(1) may not be enough.
BUILD_AR = "llvm-ar"
 
DEPENDS = "clang-native ninja-native"
DEPENDS:append:runtime-llvm = " compiler-rt-native libcxx-native"
# Use libcxx headers for native parts
CXXFLAGS:append:runtime-llvm = " -isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++"
# Use libgcc for native parts
LDFLAGS:append:runtime-llvm = " -rtlib=libgcc -unwindlib=libgcc -stdlib=libc++ -lc++abi -rpath ${STAGING_LIBDIR_NATIVE}"
 
do_configure[noexec] = "1"
 
do_compile() {
   python3 ${S}/tools/gn/bootstrap/bootstrap.py --skip-generate-buildfiles
}
 
do_install() {
   install -d ${D}${bindir}
   install -m 0755 ${S}/out/Release/gn ${D}${bindir}/gn
}
 
INSANE_SKIP:${PN} += "already-stripped"