Skip to content

staging-next 2023-09-07#253854

Merged
vcunat merged 168 commits intomasterfrom
staging-next
Sep 14, 2023
Merged

staging-next 2023-09-07#253854
vcunat merged 168 commits intomasterfrom
staging-next

Conversation

danielfullmer and others added 30 commits September 22, 2022 09:41
Currently, clang++ statically links against libstdc++ instead of
dynamically links, because the -L path included in the cc-wrapper is
incorrect. The gccForLibs.lib output only contains the architecture
subdirectory if the target and host platform are not the same. (See
targetConfig set in gcc/<version>/default.nix and the gcc/builder.nix)

This fixes the incorrect linking by using the correct path for both the
cross and native cases. This also matches the cc_solib set above in
cc-wrapper/default.nix

Tested by compiling a simple cpp binary and noting that it now correctly
dynamically links against libstdc++, natively on x86_64 and arm64, as
well as x86_64 -> arm64 cross compilation.

Co-Authored-By: Sebastian Ullrich <sebasti@nullri.ch>
While at it added trivial updater.

Changes: util-linux/util-linux@v2.39.1...v2.39.2
This PR sorts the huge pile of patches and deduplicates it.  Unlike
its predecessors #249707 and
#250489 this commit *does*
affect eval.

Patches below are organized into three general categories:

1. Patches relevant to gcc>=12 on every platform
2. Patches relevant to gcc>=12 on specific platforms
3. Patches relevant only to gcc<12, sorted by the newest version to
   which they might be relevant
Fixes `pkgsCross.musl64.llvmPackages_16.clang.cc` on `x86_64-linux`,
which used to fail with `/bin/sh: clang-tblgen: not found`.

Same hack is used in other projects:
https://github.com/search?q=%2FCMAKE_CROSSCOMPILING_EMULATOR.%2B%5C%2Fusr%5C%2Fbin%5C%2Fenv%2F+NOT+is%3Afork&type=code

Comment from https://github.com/vsrinivas/fuchsia/blob/30435a9d0f0b67c94e3c70760b522c9f7fbbd6be/build/cmake/HostLinuxToolchain.cmake#L64

> Required to run host Linux executables during the build itself.
> An example would be https://gitub.com/KhronosGroup/Vulkan-Loader and
> its "asm_offset" program.
>
> NOTE: Alternatives have been tried unsuccessfully, i.e.:
>
>  With $(set CMAKE_CROSSCOMPILING_EMULATOR), the build fails because
>  the CMake ninja/Make script tries to find the executable in the current
>  path, as in:
>
>    [3/16] Generating gen_defines.asm
>    FAILED: loader/gen_defines.asm
>    cd /tmp/cc/build-Vulkan-Loader/loader && asm_offset GAS
>    /bin/sh: asm_offset: command not found
>    ninja: build stopped: subcommand failed.
>
> With $(set CMAKE_CROSSCOMPILING_EMULATOR ""), the build fails because
> the shell cannot find the "" program as in:
>
>    [3/16] Generating gen_defines.asm
>    FAILED: loader/gen_defines.asm
>    cd /tmp/cc/build-Vulkan-Loader/loader && "" /tmp/cc/build-Vulkan-Loader/loader/asm_offset GAS
>    /bin/sh: : command not found
>    ninja: build stopped: subcommand failed.
>
> It seems that the root of the problem comes from how the CMake function
> cmCustomCommandGenerator::GetArgc0Location() computes the target
> executable's location. At this point it's unclear whether this is a CMake
> bug or a feature.

Risicle discovered this hack.

Co-authored-by: Robert Scott <code@humanleg.org.uk>
The m flag was removed in Python 3.8:
https://docs.python.org/3/whatsnew/3.8.html#build-and-c-api-changes

Co-authored-by: Anders Kaseorg <26471+andersk@users.noreply.github.com>
openembedded may have a patch for clang but i do not think it is worth
it to use it because using clangStdenv on linux is rare

https://bugs.gentoo.org/732050

`nix build --impure --expr 'with import ./. { config = { replaceStdenv = ({ pkgs }: pkgs.clangStdenv); }; }; kexec-tools'`
Fix linux clang stdenv

`nix build --impure --expr 'with import ./. { config = { replaceStdenv = ({ pkgs }: pkgs.clangStdenv); }; }; iproute2'`
@AndersonTorres
Copy link
Copy Markdown
Member

Should I force-push my staging-next over that one?

@Artturin
Copy link
Copy Markdown
Member

Pushed a 0 rebuild cross fix for iproute2

@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 11, 2023
@vcunat
Copy link
Copy Markdown
Member Author

vcunat commented Sep 12, 2023

Generally, please, only fast-forward pushes for staging-next and staging. That's my intuition, as many people may be using those branches, e.g. as bases of pull requests.

github-actions bot and others added 7 commits September 12, 2023 06:01
This CVE is critical severity and has been exploited in the wild. It was
reported as being a Chromium vulnerability, but it seems to in fact
impact libwebp (and thus all its downstream users). There is however no
official confirmation of this yet.

The upstream fix patch (webmproject/libwebp@902bc919) does not cleanly
apply onto 1.3.1, so we vendor a very slightly modified version which
does cleanly apply. This is my original work, so YMMV on whether you
trust it or not, reviews very much welcomed :-)
libwebp: cherry-pick suspected upstream fix for CVE-2023-4863
@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 12, 2023
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 13, 2023
@ofborg ofborg bot added the ofborg-internal-error Ofborg encountered an error label Sep 13, 2023
Copy link
Copy Markdown
Contributor

@yu-re-ka yu-re-ka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The jobset looks very done

@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one person. label Sep 14, 2023
@vcunat vcunat merged commit f2ea252 into master Sep 14, 2023
@vcunat
Copy link
Copy Markdown
Member Author

vcunat commented Sep 14, 2023

Yes. I see some regressions, but I'd say it's fairly good compared to average staging-next merges. (I'm hurrying because of libwebp security.)

@cole-h cole-h removed the ofborg-internal-error Ofborg encountered an error label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.severity: security Issues which raise a security issue, or PRs that fix one 6.topic: golang Go is a high-level general purpose programming language that is statically typed and compiled. 6.topic: lua Lua is a powerful, efficient, lightweight, embeddable scripting language. 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: stdenv Standard environment 6.topic: xfce The Xfce Desktop Environment 8.has: documentation This PR adds or changes documentation 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.