OSSystems / meta-browser

OpenEmbedded/Yocto BSP layer for Web Browsers
MIT License
185 stars 194 forks source link

chromium: Set LIBCPLUSPLUS to use libc++ #554

Closed kraj closed 3 years ago

kraj commented 3 years ago

This should fix issue seen with https://github.com/OSSystems/meta-browser/pull/551

Signed-off-by: Khem Raj raj.khem@gmail.com

rakuco commented 3 years ago

cc @shr-project @schnitzeltony

kraj commented 3 years ago

Does this also work with older branches like hardknott? In case of master, where we didn't seem to be passing any toolchain-related arguments per #551, doesn't it mean you also need to pass -rtlib and --unwindlib?

yes it will be a nop on hardknott and dunfell.

rakuco commented 3 years ago

In case of master, where we didn't seem to be passing any toolchain-related arguments per #551, doesn't it mean you also need to pass -rtlib and --unwindlib?

How about this part?

shr-project commented 3 years ago

This didn't work for me, because chromium doesn't seem respect CXXFLAGS/LDFLAGS ("stdlib=libc++" doesn't appear anywhere in log.do_compile - even for other modules than sql).

If I add LIBCPLUSPLUS to TUNE_CCARGS (sort of like it was in meta-clang/hardknott), then it builds OK.

shr-project commented 3 years ago

Last version works for me +1

schnitzeltony commented 3 years ago

Builds fine - thanks

shr-project commented 3 years ago

LGTM, there are some build-time benefits as well, will share the numbers shortly.

UPDATE: as in https://github.com/shr-project/test-oe-build-time/commit/d9716c706e37fb135e9e118b63f039717fb7eb80

    PR-551 "Add patch to fix build in latest oe/gcc11 environment" https://github.com/OSSystems/meta-browser/pull/551
    PR-555 "chromium-gn: respect PARALLEL_MAKE when setting max_jobs_per_link" https://github.com/OSSystems/meta-browser/pull/555 (includes PR-551 in the build test)
    PR-554 "chromium: Set LIBCPLUSPLUS to use libc++" https://github.com/OSSystems/meta-browser/pull/554 (includes PR-555 in the build test)

    P_M    PR-551   PR-555   PR-554
    -j 32  3201.93  2986.65  2890.76
    -j 48  2937.99  2703.83  2630.64
    -j 64  2700.89  2472.78  2417.64
kraj commented 3 years ago

A few remaining questions:

  • Do we still need to set RUNTIME="llvm"?

yes since it will add needed DEPENDs correctly.

  • Is this enough to make the build use compiler-rt and the rest of the LLVM toolchain in terms of arguments passed to the compiler/linker?

yes what we have is enough for now.

rakuco commented 3 years ago

@kraj @schnitzeltony I have to revert @kraj's commit, it broke the hardknott build for me. Setting LIBCPLUSPLUS actually started preventing the libc++ headers from being installed into recipe-sysroot/usr/include.