diff --git a/.github/labeler.yml b/.github/labeler.yml index 17f43402f0ca..d4f43e31b084 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -393,7 +393,7 @@ - changed-files: - any-glob-to-any-file: - nixos/modules/services/desktops/pantheon/**/* - - nixos/modules/services/x11/desktop-managers/pantheon.nix + - nixos/modules/services/desktop-managers/pantheon.nix - nixos/modules/services/x11/display-managers/lightdm-greeters/pantheon.nix - nixos/tests/pantheon.nix - pkgs/desktops/pantheon/**/* diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 8ec5e77b0f21..fc2b80041ce7 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -27,7 +27,7 @@ jobs: steps: # Use a GitHub App to create the PR so that CI gets triggered # The App is scoped to Repository > Contents and Pull Requests: write for Nixpkgs - - uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 + - uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 id: app-token with: app-id: ${{ vars.NIXPKGS_CI_APP_ID }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index c74932b67e7a..408ba7369e62 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -109,7 +109,7 @@ jobs: - name: Build codeowners validator run: nix-build nixpkgs/trusted/ci --arg nixpkgs ./nixpkgs/trusted-pinned -A codeownersValidator - - uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 + - uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 if: github.event_name == 'pull_request_target' && vars.OWNER_RO_APP_ID id: app-token with: diff --git a/.github/workflows/edited.yml b/.github/workflows/edited.yml index e944254d19cd..058c6181e2a6 100644 --- a/.github/workflows/edited.yml +++ b/.github/workflows/edited.yml @@ -36,7 +36,7 @@ jobs: # Use a GitHub App to create the PR so that CI gets triggered # The App is scoped to Repository > Contents and Pull Requests: write for Nixpkgs # We only need Pull Requests: write here, but the app is also used for backports. - - uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 + - uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 id: app-token with: app-id: ${{ vars.NIXPKGS_CI_APP_ID }} diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 94c68d859e48..79237c844589 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -49,7 +49,7 @@ jobs: run: npm install @actions/artifact bottleneck # Use a GitHub App, because it has much higher rate limits: 12,500 instead of 5,000 req / hour. - - uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 + - uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 if: github.event_name != 'pull_request' && vars.NIXPKGS_CI_APP_ID id: app-token with: diff --git a/.github/workflows/periodic-merge.yml b/.github/workflows/periodic-merge.yml index 3846d04159fc..1677b05c506c 100644 --- a/.github/workflows/periodic-merge.yml +++ b/.github/workflows/periodic-merge.yml @@ -23,7 +23,7 @@ jobs: steps: # Use a GitHub App to create the PR so that CI gets triggered # The App is scoped to Repository > Contents and Pull Requests: write for Nixpkgs - - uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 + - uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 id: app-token with: app-id: ${{ vars.NIXPKGS_CI_APP_ID }} diff --git a/.github/workflows/reviewers.yml b/.github/workflows/reviewers.yml index 0e0aaf04f850..3d5d08f8d7cf 100644 --- a/.github/workflows/reviewers.yml +++ b/.github/workflows/reviewers.yml @@ -48,7 +48,7 @@ jobs: # - OWNER_APP_PRIVATE_KEY (secret) # # Can't use the token received from permissions above, because it can't get enough permissions. - - uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 + - uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 if: github.event_name == 'pull_request_target' && vars.OWNER_APP_ID id: app-token with: diff --git a/doc/release-notes/rl-2511.section.md b/doc/release-notes/rl-2511.section.md index e3ce27937a3a..24defb6b490c 100644 --- a/doc/release-notes/rl-2511.section.md +++ b/doc/release-notes/rl-2511.section.md @@ -26,6 +26,8 @@ - GCC 9, 10, 11, and 12 have been removed, as they have reached end‐of‐life upstream and are no longer supported. +- LLVM 12, 13, 14, 15, 16, and 17 have been removed, as they have reached end‐of‐life upstream and are no longer supported. + - GHCJS 8.10, exposed via `haskell.compiler.ghcjs` and `haskell.compiler.ghcjs810`, has been removed. Downstream users should migrate their projects to the new JavaScript backend of GHC proper which can be used via `pkgsCross.ghcjs` from Nixpkgs. Haskell packaging code, like `haskellPackages.mkDerivation`, `ghcWithPackages` and `hoogleWithPackages`, also no longer supports GHCJS. - GHC 8.6, 8.10, 9.0, 9.2, and their package sets have been removed. diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 8c380244ba77..13942931a005 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -7103,6 +7103,14 @@ githubId = 2025623; name = "Luc Chabassier"; }; + dwoffinden = { + email = "daw@hey.com"; + github = "dwoffinden"; + githubId = 1432131; + keys = [ { fingerprint = "46FC 889E BC38 100E 51E8 3245 F3EA 503B 360F BD40"; } ]; + matrix = "@dwoffinden:matrix.org"; + name = "Daniel Woffinden"; + }; dwrege = { email = "email@dwrege.de"; github = "DominicWrege"; diff --git a/nixos/doc/manual/release-notes/rl-2003.section.md b/nixos/doc/manual/release-notes/rl-2003.section.md index af7d80e35899..65d03c39f21e 100644 --- a/nixos/doc/manual/release-notes/rl-2003.section.md +++ b/nixos/doc/manual/release-notes/rl-2003.section.md @@ -38,7 +38,7 @@ In addition to numerous new and upgraded packages, this release has the followin - GNOME 3 has been upgraded to 3.34. Please take a look at their [Release Notes](https://help.gnome.org/misc/release-notes/3.34) for details. -- If you enable the Pantheon Desktop Manager via [services.xserver.desktopManager.pantheon.enable](options.html#opt-services.xserver.desktopManager.pantheon.enable), we now default to also use [ Pantheon's newly designed greeter ](https://blog.elementary.io/say-hello-to-the-new-greeter/). Contrary to NixOS's usual update policy, Pantheon will receive updates during the cycle of NixOS 20.03 when backwards compatible. +- If you enable the Pantheon Desktop Manager via `services.xserver.desktopManager.pantheon.enable`, we now default to also use [ Pantheon's newly designed greeter ](https://blog.elementary.io/say-hello-to-the-new-greeter/). Contrary to NixOS's usual update policy, Pantheon will receive updates during the cycle of NixOS 20.03 when backwards compatible. - By default zfs pools will now be trimmed on a weekly basis. Trimming is only done on supported devices (i.e. NVME or SSDs) and should improve throughput and lifetime of these devices. It is controlled by the `services.zfs.trim.enable` varname. The zfs scrub service (`services.zfs.autoScrub.enable`) and the zfs autosnapshot service (`services.zfs.autoSnapshot.enable`) are now only enabled if zfs is set in `config.boot.initrd.supportedFilesystems` or `config.boot.supportedFilesystems`. These lists will automatically contain zfs as soon as any zfs mountpoint is configured in `fileSystems`. diff --git a/nixos/doc/manual/release-notes/rl-2511.section.md b/nixos/doc/manual/release-notes/rl-2511.section.md index 412ddc6f3a58..967f774d0a8b 100644 --- a/nixos/doc/manual/release-notes/rl-2511.section.md +++ b/nixos/doc/manual/release-notes/rl-2511.section.md @@ -248,6 +248,8 @@ - mate-wayland-session 1.28.4 is now using the default wayfire decorator instead of firedecor, thus `services.xserver.desktopManager.mate.enableWaylandSession` is no longer shipping firedecor. If you are experiencing broken window decorations after upgrade, backup and remove `~/.config/mate/wayfire.ini` and re-login. +- Due to [deprecation of gnome-session X11 support](https://blogs.gnome.org/alatiera/2025/06/08/the-x11-session-removal/), `services.desktopManager.pantheon` now defaults to pantheon-wayland session. The X11 session will be removed before gnome-session 49 lands. + - `services.gitea` supports sending notifications with sendmail again. To do this, activate the parameter `services.gitea.mailerUseSendmail` and configure SMTP server. - `networking.wireless.networks.` now has an option to specify SSID, hence allowing duplicated SSID setup. The BSSID option is added along side with this. diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.md b/nixos/modules/services/desktop-managers/pantheon.md similarity index 94% rename from nixos/modules/services/x11/desktop-managers/pantheon.md rename to nixos/modules/services/desktop-managers/pantheon.md index f4c488bf6dec..ec60a5949476 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.md +++ b/nixos/modules/services/desktop-managers/pantheon.md @@ -6,7 +6,7 @@ Pantheon is the desktop environment created for the elementary OS distribution. All of Pantheon is working in NixOS and the applications should be available, aside from a few [exceptions](https://github.com/NixOS/nixpkgs/issues/58161). To enable Pantheon, set ```nix -{ services.xserver.desktopManager.pantheon.enable = true; } +{ services.desktopManager.pantheon.enable = true; } ``` This automatically enables LightDM and Pantheon's LightDM greeter. If you'd like to disable this, set ```nix @@ -25,8 +25,8 @@ You can also use [](#opt-environment.pantheon.excludePackages) to remove any oth Wingpanel and Switchboard work differently than they do in other distributions, as far as using plugins. You cannot install a plugin globally (like with {option}`environment.systemPackages`) to start using it. You should instead be using the following options: - - [](#opt-services.xserver.desktopManager.pantheon.extraWingpanelIndicators) - - [](#opt-services.xserver.desktopManager.pantheon.extraSwitchboardPlugs) + - [](#opt-services.desktopManager.pantheon.extraWingpanelIndicators) + - [](#opt-services.desktopManager.pantheon.extraSwitchboardPlugs) to configure the programs with plugs or indicators. diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/desktop-managers/pantheon.nix similarity index 95% rename from nixos/modules/services/x11/desktop-managers/pantheon.nix rename to nixos/modules/services/desktop-managers/pantheon.nix index 8be5d1cdb7b7..d8beeca81b0d 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/desktop-managers/pantheon.nix @@ -10,7 +10,7 @@ with lib; let - cfg = config.services.xserver.desktopManager.pantheon; + cfg = config.services.desktopManager.pantheon; serviceCfg = config.services.pantheon; nixos-gsettings-desktop-schemas = pkgs.pantheon.elementary-gsettings-schemas.override { @@ -28,6 +28,13 @@ in maintainers = teams.pantheon.members; }; + imports = [ + (lib.mkRenamedOptionModule + [ "services" "xserver" "desktopManager" "pantheon" ] + [ "services" "desktopManager" "pantheon" ] + ) + ]; + options = { services.pantheon = { @@ -40,7 +47,7 @@ in }; - services.xserver.desktopManager.pantheon = { + services.desktopManager.pantheon = { enable = mkOption { type = types.bool; default = false; @@ -98,7 +105,7 @@ in config = mkMerge [ (mkIf cfg.enable { - services.xserver.desktopManager.pantheon.sessionPath = utils.removePackagesByName [ + services.desktopManager.pantheon.sessionPath = utils.removePackagesByName [ pkgs.pantheon.pantheon-agent-geoclue2 ] config.environment.pantheon.excludePackages; @@ -114,7 +121,14 @@ in # Without this, elementary LightDM greeter will pre-select non-existent `default` session # https://github.com/elementary/greeter/issues/368 - services.displayManager.defaultSession = mkDefault "pantheon"; + services.displayManager.defaultSession = mkDefault "pantheon-wayland"; + programs.dconf.profiles.user.databases = [ + { + settings."io/elementary/greeter" = { + last-session-type = "pantheon-wayland"; + }; + } + ]; environment.extraInit = '' ${concatMapStrings (p: '' diff --git a/nixos/modules/services/networking/umurmur.nix b/nixos/modules/services/networking/umurmur.nix index 9cceebe8aec1..8a821534c585 100644 --- a/nixos/modules/services/networking/umurmur.nix +++ b/nixos/modules/services/networking/umurmur.nix @@ -53,14 +53,14 @@ in let valueType = with lib.types; - oneOf [ + (attrsOf (oneOf [ bool int float str path - (listOf (attrsOf valueType)) - ] + (listOf valueType) + ])) // { description = "uMurmur config value"; }; diff --git a/nixos/modules/services/x11/desktop-managers/default.nix b/nixos/modules/services/x11/desktop-managers/default.nix index 25fc53285aa7..528a049b3582 100644 --- a/nixos/modules/services/x11/desktop-managers/default.nix +++ b/nixos/modules/services/x11/desktop-managers/default.nix @@ -33,7 +33,7 @@ in ./retroarch.nix ./kodi.nix ./mate.nix - ./pantheon.nix + ../../desktop-managers/pantheon.nix ./surf-display.nix ./cde.nix ./cinnamon.nix diff --git a/nixos/release.nix b/nixos/release.nix index f0d9c30185e5..e254b51aa051 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -525,7 +525,7 @@ rec { { ... }: { services.xserver.enable = true; - services.xserver.desktopManager.pantheon.enable = true; + services.desktopManager.pantheon.enable = true; } ); diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 0e8bd805411e..93243f29082a 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -1143,7 +1143,6 @@ in pam-zfs-key = runTest ./pam/zfs-key.nix; pantalaimon = runTest ./matrix/pantalaimon.nix; pantheon = runTest ./pantheon.nix; - pantheon-wayland = runTest ./pantheon-wayland.nix; paperless = runTest ./paperless.nix; paretosecurity = runTest ./paretosecurity.nix; parsedmarc = handleTest ./parsedmarc { }; diff --git a/nixos/tests/pantheon-wayland.nix b/nixos/tests/pantheon-wayland.nix deleted file mode 100644 index 87c8b17a692c..000000000000 --- a/nixos/tests/pantheon-wayland.nix +++ /dev/null @@ -1,104 +0,0 @@ -{ pkgs, lib, ... }: - -{ - name = "pantheon-wayland"; - - meta.maintainers = lib.teams.pantheon.members; - - nodes.machine = - { nodes, ... }: - - let - videosAutostart = pkgs.writeTextFile { - name = "autostart-elementary-videos"; - destination = "/etc/xdg/autostart/io.elementary.videos.desktop"; - text = '' - [Desktop Entry] - Version=1.0 - Name=Videos - Type=Application - Terminal=false - Exec=io.elementary.videos %U - ''; - }; - in - { - imports = [ ./common/user-account.nix ]; - - # Workaround ".gala-wrapped invoked oom-killer" - virtualisation.memorySize = 2047; - - services.xserver.enable = true; - services.xserver.desktopManager.pantheon.enable = true; - services.displayManager = { - autoLogin.enable = true; - autoLogin.user = nodes.machine.users.users.alice.name; - defaultSession = "pantheon-wayland"; - }; - - # We ship pantheon.appcenter by default when this is enabled. - services.flatpak.enable = true; - - # For basic OCR tests. - environment.systemPackages = [ videosAutostart ]; - - # We don't ship gnome-text-editor in Pantheon module, we add this line mainly - # to catch eval issues related to this option. - environment.pantheon.excludePackages = [ pkgs.gnome-text-editor ]; - }; - - enableOCR = true; - - testScript = - { nodes, ... }: - let - user = nodes.machine.users.users.alice; - in - '' - machine.wait_for_unit("display-manager.service") - - with subtest("Wait for wayland server"): - machine.wait_for_file("/run/user/${toString user.uid}/wayland-0") - - with subtest("Check that logging in has given the user ownership of devices"): - machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}") - - with subtest("Check if Pantheon components actually start"): - # We specifically check gsd-xsettings here since it is manually pulled up by gala. - # https://github.com/elementary/gala/pull/2140 - for i in ["gala", "io.elementary.wingpanel", "io.elementary.dock", "gsd-media-keys", "gsd-xsettings", "io.elementary.desktop.agent-polkit"]: - machine.wait_until_succeeds(f"pgrep -f {i}") - machine.wait_until_succeeds("pgrep -xf ${pkgs.pantheon.elementary-files}/libexec/io.elementary.files.xdg-desktop-portal") - - with subtest("Check if various environment variables are set"): - cmd = "xargs --null --max-args=1 echo < /proc/$(pgrep -xf ${pkgs.pantheon.gala}/bin/gala)/environ" - machine.succeed(f"{cmd} | grep 'XDG_CURRENT_DESKTOP' | grep 'Pantheon'") - machine.succeed(f"{cmd} | grep 'XDG_SESSION_TYPE' | grep 'wayland'") - # Hopefully from the sessionPath option. - machine.succeed(f"{cmd} | grep 'XDG_DATA_DIRS' | grep 'gsettings-schemas/pantheon-agent-geoclue2'") - # Hopefully from login shell. - machine.succeed(f"{cmd} | grep '__NIXOS_SET_ENVIRONMENT_DONE' | grep '1'") - # Hopefully from gcr-ssh-agent. - machine.succeed(f"{cmd} | grep 'SSH_AUTH_SOCK' | grep 'gcr'") - - with subtest("Wait for elementary videos autostart"): - machine.wait_until_succeeds("pgrep -f io.elementary.videos") - machine.wait_for_text("No Videos Open") - machine.screenshot("videos") - - with subtest("Trigger multitasking view"): - cmd = "dbus-send --session --dest=org.pantheon.gala --print-reply /org/pantheon/gala org.pantheon.gala.PerformAction int32:1" - env = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus" - machine.succeed(f"su - ${user.name} -c '{env} {cmd}'") - machine.sleep(5) - machine.screenshot("multitasking") - machine.succeed(f"su - ${user.name} -c '{env} {cmd}'") - - with subtest("Check if gala has ever coredumped"): - machine.fail("coredumpctl --json=short | grep gala") - # So we can see the dock. - machine.execute("pkill -f -9 io.elementary.videos") - machine.sleep(10) - machine.screenshot("screen") - ''; -} diff --git a/nixos/tests/pantheon.nix b/nixos/tests/pantheon.nix index 855d0f48f80c..b44065ebacdb 100644 --- a/nixos/tests/pantheon.nix +++ b/nixos/tests/pantheon.nix @@ -8,6 +8,20 @@ nodes.machine = { ... }: + let + videosAutostart = pkgs.writeTextFile { + name = "autostart-elementary-videos"; + destination = "/etc/xdg/autostart/io.elementary.videos.desktop"; + text = '' + [Desktop Entry] + Version=1.0 + Name=Videos + Type=Application + Terminal=false + Exec=io.elementary.videos %U + ''; + }; + in { imports = [ ./common/user-account.nix ]; @@ -15,16 +29,19 @@ virtualisation.memorySize = 2047; services.xserver.enable = true; - services.xserver.desktopManager.pantheon.enable = true; + services.desktopManager.pantheon.enable = true; # We ship pantheon.appcenter by default when this is enabled. services.flatpak.enable = true; + # For basic OCR tests. + environment.systemPackages = [ videosAutostart ]; + # We don't ship gnome-text-editor in Pantheon module, we add this line mainly # to catch eval issues related to this option. environment.pantheon.excludePackages = [ pkgs.gnome-text-editor ]; - environment.systemPackages = [ pkgs.xdotool ]; + programs.ydotool.enable = true; }; enableOCR = true; @@ -33,7 +50,6 @@ { nodes, ... }: let user = nodes.machine.users.users.alice; - bob = nodes.machine.users.users.bob; in '' machine.wait_for_unit("display-manager.service") @@ -41,34 +57,34 @@ with subtest("Test we can see usernames in elementary-greeter"): machine.wait_for_text("${user.description}") machine.wait_until_succeeds("pgrep -f io.elementary.greeter-compositor") - # OCR was struggling with this one. - # machine.wait_for_text("${bob.description}") # Ensure the password box is focused by clicking it. # Workaround for https://github.com/NixOS/nixpkgs/issues/211366. - machine.succeed("XAUTHORITY=/var/lib/lightdm/.Xauthority DISPLAY=:0 xdotool mousemove 512 505 click 1") + machine.succeed("ydotool mousemove -a 220 275") + machine.succeed("ydotool click 0xC0") machine.sleep(2) machine.screenshot("elementary_greeter_lightdm") with subtest("Login with elementary-greeter"): machine.send_chars("${user.password}\n") - machine.wait_for_x() - machine.wait_for_file("${user.home}/.Xauthority") - machine.succeed("xauth merge ${user.home}/.Xauthority") machine.wait_until_succeeds('journalctl -t gnome-session-binary --grep "Entering running state"') + with subtest("Wait for wayland server"): + machine.wait_for_file("/run/user/${toString user.uid}/wayland-0") + with subtest("Check that logging in has given the user ownership of devices"): machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}") with subtest("Check if Pantheon components actually start"): - for i in ["gala", "io.elementary.wingpanel", "io.elementary.dock", "gsd-media-keys", "io.elementary.desktop.agent-polkit"]: + # We specifically check gsd-xsettings here since it is manually pulled up by gala. + # https://github.com/elementary/gala/pull/2140 + for i in ["gala", "io.elementary.wingpanel", "io.elementary.dock", "gsd-media-keys", "gsd-xsettings", "io.elementary.desktop.agent-polkit"]: machine.wait_until_succeeds(f"pgrep -f {i}") - for i in ["gala", "io.elementary.wingpanel", "io.elementary.dock"]: - machine.wait_for_window(i) machine.wait_until_succeeds("pgrep -xf ${pkgs.pantheon.elementary-files}/libexec/io.elementary.files.xdg-desktop-portal") with subtest("Check if various environment variables are set"): cmd = "xargs --null --max-args=1 echo < /proc/$(pgrep -xf ${pkgs.pantheon.gala}/bin/gala)/environ" machine.succeed(f"{cmd} | grep 'XDG_CURRENT_DESKTOP' | grep 'Pantheon'") + machine.succeed(f"{cmd} | grep 'XDG_SESSION_TYPE' | grep 'wayland'") # Hopefully from the sessionPath option. machine.succeed(f"{cmd} | grep 'XDG_DATA_DIRS' | grep 'gsettings-schemas/pantheon-agent-geoclue2'") # Hopefully from login shell. @@ -76,31 +92,14 @@ # Hopefully from gcr-ssh-agent. machine.succeed(f"{cmd} | grep 'SSH_AUTH_SOCK' | grep 'gcr'") - with subtest("Open elementary videos"): - machine.execute("su - ${user.name} -c 'DISPLAY=:0 io.elementary.videos >&2 &'") - machine.sleep(2) - machine.wait_for_window("io.elementary.videos") + with subtest("Wait for elementary videos autostart"): + machine.wait_until_succeeds("pgrep -f io.elementary.videos") machine.wait_for_text("No Videos Open") - - with subtest("Open elementary calendar"): - machine.wait_until_succeeds("pgrep -f evolution-calendar-factory") - machine.execute("su - ${user.name} -c 'DISPLAY=:0 io.elementary.calendar >&2 &'") - machine.sleep(2) - machine.wait_for_window("io.elementary.calendar") - - with subtest("Open system settings"): - machine.execute("su - ${user.name} -c 'DISPLAY=:0 io.elementary.settings >&2 &'") - # Wait for all plugins to be loaded before we check if the window is still there. - machine.sleep(5) - machine.wait_for_window("io.elementary.settings") - - with subtest("Open elementary terminal"): - machine.execute("su - ${user.name} -c 'DISPLAY=:0 io.elementary.terminal >&2 &'") - machine.wait_for_window("io.elementary.terminal") + machine.screenshot("videos") with subtest("Trigger multitasking view"): cmd = "dbus-send --session --dest=org.pantheon.gala --print-reply /org/pantheon/gala org.pantheon.gala.PerformAction int32:1" - env = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus DISPLAY=:0" + env = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus" machine.succeed(f"su - ${user.name} -c '{env} {cmd}'") machine.sleep(5) machine.screenshot("multitasking") @@ -108,8 +107,8 @@ with subtest("Check if gala has ever coredumped"): machine.fail("coredumpctl --json=short | grep gala") - # So you can see the dock in the below screenshot. - machine.succeed("su - ${user.name} -c 'DISPLAY=:0 xdotool mousemove 450 1000 >&2 &'") + # So we can see the dock. + machine.execute("pkill -f -9 io.elementary.videos") machine.sleep(10) machine.screenshot("screen") ''; diff --git a/pkgs/by-name/bf/bfc/package.nix b/pkgs/by-name/bf/bfc/package.nix deleted file mode 100644 index a1fcf0e730a4..000000000000 --- a/pkgs/by-name/bf/bfc/package.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - lib, - rustPlatform, - fetchFromGitHub, - llvmPackages_13, - libxml2, - ncurses, - zlib, - stdenv, -}: - -rustPlatform.buildRustPackage rec { - pname = "bfc"; - version = "1.12.0"; - - src = fetchFromGitHub { - owner = "Wilfred"; - repo = "bfc"; - rev = version; - hash = "sha256-5pcvwCtXWEexvV3TS62dZ6Opg8ANP2L8B0Z8u/OQENU="; - }; - - cargoHash = "sha256-S8Fy0PRSUftljcX34Sj8MmlPW7Oob2yayPUA1RRxf8E="; - - buildInputs = [ - libxml2 - ncurses - zlib - ]; - - env.LLVM_SYS_130_PREFIX = llvmPackages_13.llvm.dev; - - # process didn't exit successfully: <...> SIGSEGV - doCheck = false; - - meta = with lib; { - description = "Industrial-grade brainfuck compiler"; - mainProgram = "bfc"; - homepage = "https://bfc.wilfred.me.uk"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ figsoda ]; - broken = stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux; - }; -} diff --git a/pkgs/by-name/ca/calamares-nixos-extensions/src/modules/nixos/main.py b/pkgs/by-name/ca/calamares-nixos-extensions/src/modules/nixos/main.py index d947fdf296b8..85e259d42d11 100644 --- a/pkgs/by-name/ca/calamares-nixos-extensions/src/modules/nixos/main.py +++ b/pkgs/by-name/ca/calamares-nixos-extensions/src/modules/nixos/main.py @@ -140,7 +140,7 @@ cfgpantheon = """ # Enable the X11 windowing system. # Enable the Pantheon Desktop Environment. services.xserver.displayManager.lightdm.enable = true; - services.xserver.desktopManager.pantheon.enable = true; + services.desktopManager.pantheon.enable = true; """ diff --git a/pkgs/by-name/da/dale/package.nix b/pkgs/by-name/da/dale/package.nix deleted file mode 100644 index 350a54f650cc..000000000000 --- a/pkgs/by-name/da/dale/package.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - cmake, - pkg-config, - libffi, - llvm_13, - perl, -}: - -stdenv.mkDerivation { - pname = "dale"; - version = "20220411"; - - src = fetchFromGitHub { - owner = "tomhrr"; - repo = "dale"; - rev = "7386ef2d8912c60c6fb157a1e5cd772e15eaf658"; - sha256 = "sha256-LNWqrFuEjtL7zuPTBfe4qQWr8IrT/ldQWSeDTK3Wqmo="; - }; - - nativeBuildInputs = [ - cmake - pkg-config - llvm_13.dev - ]; - buildInputs = [ - libffi - llvm_13 - ]; - - nativeCheckInputs = [ perl ]; - - checkTarget = "tests"; - - meta = with lib; { - description = "Lisp-flavoured C"; - longDescription = '' - Dale is a system (no GC) programming language that uses - S-expressions for syntax and supports syntactic macros. - ''; - homepage = "https://github.com/tomhrr/dale"; - license = licenses.bsd3; - maintainers = with maintainers; [ amiloradovsky ]; - platforms = [ - "i686-linux" - "x86_64-linux" - "aarch64-linux" - ]; - # failed on Darwin: linker couldn't find the FFI lib - }; -} diff --git a/pkgs/by-name/ho/hobbes/package.nix b/pkgs/by-name/ho/hobbes/package.nix deleted file mode 100644 index c89bab84c2ab..000000000000 --- a/pkgs/by-name/ho/hobbes/package.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ - lib, - stdenv, - llvmPackages, - fetchFromGitHub, - cmake, - llvm_12, - ncurses, - readline, - zlib, - libxml2, - python3, -}: -llvmPackages.stdenv.mkDerivation { - pname = "hobbes"; - version = "0-unstable-2025-04-23"; - - src = fetchFromGitHub { - owner = "morganstanley"; - repo = "hobbes"; - rev = "0829030be03d47f91075cbebd0c9565f44bf9911"; - hash = "sha256-GZ26XL4++2MWQED2tVWeJ8HFcFQUXnXZ3+JCgdlAXNo="; - }; - - CXXFLAGS = [ - "-Wno-error=missing-template-arg-list-after-template-kw" - "-Wno-error=deprecated-copy" - ]; - - nativeBuildInputs = [ - cmake - ]; - - buildInputs = [ - llvm_12 - ncurses - readline - zlib - libxml2 - python3 - ]; - - doCheck = true; - checkTarget = "test"; - - meta = with lib; { - broken = stdenv.hostPlatform.isDarwin; - description = "Language and an embedded JIT compiler"; - longDescription = '' - Hobbes is a a language, embedded compiler, and runtime for efficient - dynamic expression evaluation, data storage and analysis. - ''; - homepage = "https://github.com/morganstanley/hobbes"; - license = licenses.asl20; - maintainers = with maintainers; [ - kthielen - thmzlt - ]; - platforms = [ - "x86_64-linux" - "x86_64-darwin" - ]; - }; -} diff --git a/pkgs/by-name/le/ledfx/package.nix b/pkgs/by-name/le/ledfx/package.nix index dd7717cbf6b0..6b3599eb0d89 100644 --- a/pkgs/by-name/le/ledfx/package.nix +++ b/pkgs/by-name/le/ledfx/package.nix @@ -6,12 +6,12 @@ python3.pkgs.buildPythonApplication rec { pname = "ledfx"; - version = "2.0.109"; + version = "2.0.110"; pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-fSb3NBl1bYCfwDkWI7/KeFIVcXTPDKBbLe0sQhneX6A="; + hash = "sha256-utYpAIt9ThgV58h4p3d2q/pLfCU2zlXyCnTP2kqkDjg="; }; pythonRelaxDeps = true; @@ -36,6 +36,7 @@ python3.pkgs.buildPythonApplication rec { icmplib mss multidict + netifaces2 numpy openrgb-python paho-mqtt diff --git a/pkgs/by-name/lr/lrcsnc/package.nix b/pkgs/by-name/lr/lrcsnc/package.nix new file mode 100644 index 000000000000..d2759ad8b7cb --- /dev/null +++ b/pkgs/by-name/lr/lrcsnc/package.nix @@ -0,0 +1,40 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + nix-update-script, +}: + +buildGoModule (finalAttrs: { + pname = "lrcsnc"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "Endg4meZer0"; + repo = "lrcsnc"; + tag = "v${finalAttrs.version}"; + hash = "sha256-gKb0cTpCPlyvJFthV1csn8HaVcUvXq+KC+nTT5sGhww="; + }; + + vendorHash = "sha256-ww+SXy29woGlb120sj1oGb4MIQJzpBCKGpUKYsYxTMk="; + + ldflags = [ "-X lrcsnc/internal/setup.version=${finalAttrs.version}" ]; + + # The tests require network access + doCheck = false; + + postInstall = '' + install -Dm644 LICENSE $out/share/licenses/lrcsnc/LICENSE + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Player-agnostic synced lyrics fetcher and displayer"; + homepage = "https://github.com/Endg4meZer0/lrcsnc"; + mainProgram = "lrcsnc"; + license = lib.licenses.mit; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ lonerOrz ]; + }; +}) diff --git a/pkgs/by-name/ma/maphosts/package.nix b/pkgs/by-name/ma/maphosts/package.nix index 4b9e75c311ee..b62176f5f9e5 100644 --- a/pkgs/by-name/ma/maphosts/package.nix +++ b/pkgs/by-name/ma/maphosts/package.nix @@ -13,7 +13,7 @@ let gemdir = ./.; }; in -stdenv.mkDerivation { +stdenv.mkDerivation (finalAttrs: { pname = "maphosts"; version = env.gems.maphosts.version; @@ -26,16 +26,16 @@ stdenv.mkDerivation { passthru.updateScript = bundlerUpdateScript "maphosts"; - meta = with lib; { + meta = { description = "Small command line application for keeping your project hostnames in sync with /etc/hosts"; homepage = "https://github.com/mpscholten/maphosts"; - changelog = "https://github.com/mpscholten/maphosts/releases/tag/v${version}"; - license = licenses.mit; - maintainers = with maintainers; [ + changelog = "https://github.com/mpscholten/maphosts/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ mpscholten nicknovitski ]; - platforms = platforms.all; + platforms = lib.platforms.all; mainProgram = "maphosts"; }; -} +}) diff --git a/pkgs/by-name/me/mercurial/package.nix b/pkgs/by-name/me/mercurial/package.nix index e702b5250788..7df8e2b3955e 100644 --- a/pkgs/by-name/me/mercurial/package.nix +++ b/pkgs/by-name/me/mercurial/package.nix @@ -117,18 +117,18 @@ let mercurial-tests = makeTests { flags = "--with-hg=$MERCURIAL_BASE/bin/hg"; }; }; - meta = with lib; { + meta = { description = "Fast, lightweight SCM system for very large distributed projects"; homepage = "https://www.mercurial-scm.org"; downloadPage = "https://www.mercurial-scm.org/release/"; - changelog = "https://wiki.mercurial-scm.org/Release${versions.majorMinor version}"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ + changelog = "https://wiki.mercurial-scm.org/Release${lib.versions.majorMinor version}"; + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ lukegb euxane techknowlogick ]; - platforms = platforms.unix; + platforms = lib.platforms.unix; mainProgram = "hg"; }; }; diff --git a/pkgs/by-name/mo/mopac/package.nix b/pkgs/by-name/mo/mopac/package.nix index 0de32cae6421..180a4a692986 100644 --- a/pkgs/by-name/mo/mopac/package.nix +++ b/pkgs/by-name/mo/mopac/package.nix @@ -13,13 +13,13 @@ assert blas.isILP64 == lapack.isILP64; stdenv.mkDerivation rec { pname = "mopac"; - version = "23.1.2"; + version = "23.2"; src = fetchFromGitHub { owner = "openmopac"; repo = "mopac"; rev = "v${version}"; - hash = "sha256-guMPXz7nQWxnmY4f+CGIAf3MBiV00GxSEdsZQ2fAjh4="; + hash = "sha256-P2BEXzclHJHSoaIIgCKVC3j63Af+J6rO0acwjv9ybbA="; }; nativeBuildInputs = [ diff --git a/pkgs/by-name/mp/mpris-discord-rpc/package.nix b/pkgs/by-name/mp/mpris-discord-rpc/package.nix deleted file mode 100644 index 487038ca16e2..000000000000 --- a/pkgs/by-name/mp/mpris-discord-rpc/package.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ - lib, - rustPlatform, - fetchFromGitHub, - pkg-config, - dbus, - openssl, - stdenv, -}: - -rustPlatform.buildRustPackage (finalAttrs: { - pname = "mpris-discord-rpc"; - version = "0.5.1"; - - src = fetchFromGitHub { - owner = "patryk-ku"; - repo = "mpris-discord-rpc"; - tag = "v${finalAttrs.version}"; - hash = "sha256-tPIm07q5HWosqhA3zefyuwM+fIztNZe1sSpB/NmUIoE="; - }; - - cargoHash = "sha256-3MJAvCc0ekUQ+eM5n8MdPNxXJWUgV76vi/Rq7GhhEPE="; - - nativeBuildInputs = [ - pkg-config - ]; - - buildInputs = [ - dbus - openssl - ]; - - postInstall = '' - mkdir --parents $out/etc/systemd/user - substitute $src/mpris-discord-rpc.service $out/etc/systemd/user/mpris-discord-rpc.service \ - --replace-fail /usr/bin/mpris-discord-rpc $out/bin/mpris-discord-rpc - ''; - - meta = { - description = "Linux Discord rich presence for music, using MPRIS with album cover and progress bar support"; - homepage = "https://github.com/patryk-ku/mpris-discord-rpc"; - changelog = "https://github.com/patryk-ku/mpris-discord-rpc/blob/${finalAttrs.src.tag}/CHANGELOG.md"; - license = lib.licenses.mit; - maintainers = [ lib.maintainers.lukaswrz ]; - mainProgram = "mpris-discord-rpc"; - }; -}) diff --git a/pkgs/by-name/mu/music-discord-rpc/package.nix b/pkgs/by-name/mu/music-discord-rpc/package.nix new file mode 100644 index 000000000000..46123aea3aaf --- /dev/null +++ b/pkgs/by-name/mu/music-discord-rpc/package.nix @@ -0,0 +1,47 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + pkg-config, + dbus, + openssl, + stdenv, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "music-discord-rpc"; + version = "0.6.1"; + + src = fetchFromGitHub { + owner = "patryk-ku"; + repo = "music-discord-rpc"; + tag = "v${finalAttrs.version}"; + hash = "sha256-+MSrGrnjkyLTCqQiSC2OIGAMgA2oLFqvUtud0kwTTGA="; + }; + + cargoHash = "sha256-Waw/7ErijLSq1RYtjlmtjP8vHYl3wXmRAXvGvH3wOZA="; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + dbus + openssl + ]; + + postInstall = '' + mkdir --parents $out/etc/systemd/user + substitute music-discord-rpc.service $out/etc/systemd/user/music-discord-rpc.service \ + --replace-fail /usr/bin/music-discord-rpc $out/bin/music-discord-rpc + ''; + + meta = { + description = "Cross-platform Discord rich presence for music with album cover and progress bar support"; + homepage = "https://github.com/patryk-ku/music-discord-rpc"; + changelog = "https://github.com/patryk-ku/music-discord-rpc/blob/${finalAttrs.src.tag}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.lukaswrz ]; + mainProgram = "music-discord-rpc"; + }; +}) diff --git a/pkgs/by-name/oc/oclgrind/package.nix b/pkgs/by-name/oc/oclgrind/package.nix deleted file mode 100644 index 4e21f36a6652..000000000000 --- a/pkgs/by-name/oc/oclgrind/package.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - cmake, - llvmPackages_13, - readline, - python3, -}: - -stdenv.mkDerivation rec { - pname = "oclgrind"; - version = "21.10"; - - src = fetchFromGitHub { - owner = "jrprice"; - repo = "oclgrind"; - rev = "v${version}"; - sha256 = "sha256-DGCF7X2rPV1w9guxg2bMylRirXQgez24sG7Unlct3ow="; - }; - - nativeBuildInputs = [ cmake ]; - nativeCheckInputs = [ python3 ]; - buildInputs = [ - llvmPackages_13.llvm - llvmPackages_13.clang-unwrapped - readline - ]; - - cmakeFlags = [ - "-DCLANG_ROOT=${llvmPackages_13.clang-unwrapped}" - (lib.cmakeBool "CMAKE_SKIP_RPATH" true) - ]; - - meta = with lib; { - description = "OpenCL device simulator and debugger"; - homepage = "https://github.com/jrprice/oclgrind"; - license = licenses.bsd3; - platforms = platforms.linux; - maintainers = with maintainers; [ athas ]; - }; -} diff --git a/pkgs/by-name/pg/pgf2/package.nix b/pkgs/by-name/pg/pgf2/package.nix index c966046a7f09..53723754cddc 100644 --- a/pkgs/by-name/pg/pgf2/package.nix +++ b/pkgs/by-name/pg/pgf2/package.nix @@ -27,12 +27,12 @@ stdenvNoCC.mkDerivation (finalAttrs: { runHook postInstall ''; - meta = with lib; { + meta = { homepage = "https://github.com/pgf-tikz/pgf"; description = "Portable Graphic Format for TeX"; - branch = lib.versions.major version; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ ]; - platforms = platforms.unix; + branch = lib.versions.major finalAttrs.version; + license = lib.licenses.gpl2Plus; + maintainers = [ ]; + platforms = lib.platforms.unix; }; }) diff --git a/pkgs/by-name/pg/pgf3/package.nix b/pkgs/by-name/pg/pgf3/package.nix index 2ee9301d60b0..7f9a96a1ab60 100644 --- a/pkgs/by-name/pg/pgf3/package.nix +++ b/pkgs/by-name/pg/pgf3/package.nix @@ -27,12 +27,12 @@ stdenvNoCC.mkDerivation (finalAttrs: { runHook postInstall ''; - meta = with lib; { + meta = { homepage = "https://github.com/pgf-tikz/pgf"; description = "Portable Graphic Format for TeX - version ${finalAttrs.version}"; - branch = lib.versions.major version; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ ]; - platforms = platforms.unix; + branch = lib.versions.major finalAttrs.version; + license = lib.licenses.gpl2Plus; + maintainers = [ ]; + platforms = lib.platforms.unix; }; }) diff --git a/pkgs/by-name/ps/pshash/package.nix b/pkgs/by-name/ps/pshash/package.nix index 95abcae42bf8..8f7579fe23d1 100644 --- a/pkgs/by-name/ps/pshash/package.nix +++ b/pkgs/by-name/ps/pshash/package.nix @@ -5,12 +5,12 @@ }: haskellPackages.mkDerivation rec { pname = "pshash"; - version = "0.1.15.1"; + version = "0.1.16.0"; src = fetchFromGitHub { owner = "thornoar"; repo = "pshash"; tag = "v${version}"; - hash = "sha256-TnMXT0sgUkHCbZ2YgDmSgOg8A2DKk/LyKK2XXwabrYc="; + hash = "sha256-3Qe52Hto3Z96b5q9TLz7XB7BzMfdNBd4p8V6dknH6VM="; }; postPatch = '' diff --git a/pkgs/by-name/qr/qrscan/package.nix b/pkgs/by-name/qr/qrscan/package.nix deleted file mode 100644 index bd4a3f528bc2..000000000000 --- a/pkgs/by-name/qr/qrscan/package.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - clang_15, - lib, - rustPlatform, - fetchFromGitHub, - stdenv, -}: - -rustPlatform.buildRustPackage rec { - pname = "qrscan"; - version = "0.1.9"; - - src = fetchFromGitHub { - owner = "sayanarijit"; - repo = "qrscan"; - rev = "v${version}"; - hash = "sha256-nAUZUE7NppsCAV8UyR8+OkikT4nJtnamsSVeyNz21EQ="; - }; - - nativeBuildInputs = [ - (rustPlatform.bindgenHook.overrideAttrs { - libclang = clang_15.cc.lib; - }) - ]; - - cargoHash = "sha256-hBDB/Cp8JTk9hF3qDBCb7LicUZdpXHm2i2dsuw5geO4="; - - checkFlags = [ - # requires filesystem write access - "--skip=tests::test_export_files" - "--skip=tests::test_scan_from_stdin" - "--skip=tests::test_scan_jpeg_file" - "--skip=tests::test_scan_no_content" - "--skip=tests::test_scan_png_file" - ]; - - meta = with lib; { - description = "Scan a QR code in the terminal using the system camera or a given image"; - mainProgram = "qrscan"; - homepage = "https://github.com/sayanarijit/qrscan"; - license = licenses.mit; - broken = stdenv.hostPlatform.isDarwin; - maintainers = [ maintainers.sayanarijit ]; - }; -} diff --git a/pkgs/by-name/ra/radio-active/package.nix b/pkgs/by-name/ra/radio-active/package.nix new file mode 100644 index 000000000000..e78d6872c5f1 --- /dev/null +++ b/pkgs/by-name/ra/radio-active/package.nix @@ -0,0 +1,68 @@ +{ + lib, + python3Packages, + fetchFromGitHub, + ffmpeg, +}: + +let + ## https://github.com/deep5050/radio-active/blob/main/requirements.txt + pyradios_1-0-2 = python3Packages.pyradios.overrideAttrs ( + finalAttrs: previousAttrs: + let + version = "1.0.2"; + in + { + inherit version; + + src = previousAttrs.src.override { + inherit version; + hash = "sha256-O30ExmvWu4spwDytFVPWGjR8w3XSTaWd2Z0LGQibq9g="; + }; + } + ); + + pname = "radio-active"; + version = "2.9.1"; +in +python3Packages.buildPythonApplication { + inherit pname version; + pyproject = true; + + src = fetchFromGitHub { + owner = "S0AndS0"; + repo = "radio-active"; + rev = "2befa6a309d9c411ef1ea522e706ed3e098e5341"; + hash = "sha256-wqETmdqvxsKnjkjQADq59J83QkOhLA74SPtuWTpsvO0="; + }; + + postPatch = '' + substituteInPlace radioactive/recorder.py \ + --replace-fail '"ffmpeg",' '"${lib.getExe ffmpeg}",' + + substituteInPlace radioactive/ffplay.py \ + --replace-fail 'self.exe_path = which(self.program_name)' \ + 'self.exe_path = "${ffmpeg.outPath}/bin/ffplay"' + ''; + + build-system = with python3Packages; [ setuptools ]; + + dependencies = with python3Packages; [ + requests + urllib3 + psutil + pyradios_1-0-2 + zenlog + requests-cache + rich + pick + ]; + + meta = { + description = "Play any radios from around the globe right from the terminal"; + homepage = "https://www.radio-browser.info/"; + changelog = "https://github.com/deep5050/radio-active/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ S0AndS0 ]; + }; +} diff --git a/pkgs/by-name/sh/shader-slang/package.nix b/pkgs/by-name/sh/shader-slang/package.nix index 46040c7d5408..bbbf97d396a0 100644 --- a/pkgs/by-name/sh/shader-slang/package.nix +++ b/pkgs/by-name/sh/shader-slang/package.nix @@ -11,7 +11,7 @@ libX11, glslang, unordered_dense, - llvmPackages_14, + llvmPackages, versionCheckHook, gitUpdater, @@ -73,10 +73,8 @@ stdenv.mkDerivation (finalAttrs: { libX11 ] ++ lib.optionals withLLVM [ - # Slang only supports LLVM 14: - # https://github.com/shader-slang/slang/blob/v2025.15/docs/building.md#llvm-support - llvmPackages_14.llvm - llvmPackages_14.libclang + llvmPackages.llvm + llvmPackages.libclang ] ++ lib.optionals withGlslang [ # SPIRV-tools is included in glslang. @@ -150,5 +148,8 @@ stdenv.mkDerivation (finalAttrs: { maintainers = with lib.maintainers; [ niklaskorz ]; mainProgram = "slangc"; platforms = lib.platforms.all; + # Slang only supports LLVM 14: + # https://github.com/shader-slang/slang/blob/v2025.15/docs/building.md#llvm-support + broken = withLLVM; }; }) diff --git a/pkgs/by-name/sn/sniffnet/package.nix b/pkgs/by-name/sn/sniffnet/package.nix index 589e68c4978d..8b4abb822aa9 100644 --- a/pkgs/by-name/sn/sniffnet/package.nix +++ b/pkgs/by-name/sn/sniffnet/package.nix @@ -1,32 +1,41 @@ { lib, + stdenv, rustPlatform, fetchFromGitHub, + + # nativeBuildInputs pkg-config, + + # buildInputs libpcap, - libxkbcommon, openssl, - stdenv, alsa-lib, expat, fontconfig, vulkan-loader, - wayland, xorg, + + # wrapper + libxkbcommon, + wayland, + + # tests + versionCheckHook, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "sniffnet"; - version = "1.3.2"; + version = "1.4.1"; src = fetchFromGitHub { owner = "gyulyvgc"; repo = "sniffnet"; - tag = "v${version}"; - hash = "sha256-MWYCXLIv0euEHkfqZCxbfs1wFHkGIFk06wn7F8CIXx0="; + tag = "v${finalAttrs.version}"; + hash = "sha256-EgnFDF+K8qGjunWB20VA8bXLzNvyGzcIaim+smhW5fU="; }; - cargoHash = "sha256-M7vIiGdH5+rdlqi603bfcXZavUAx2tU7+4sXb+QG+2g="; + cargoHash = "sha256-22P1EeZ2FqwIHjr23oJCKvg3ggT1Me93goELwZ/B9S4="; nativeBuildInputs = [ pkg-config ]; @@ -51,6 +60,7 @@ rustPlatform.buildRustPackage rec { # requires internet access checkFlags = [ "--skip=secondary_threads::check_updates::tests::fetch_latest_release_from_github" + "--skip=utils::check_updates::tests::fetch_latest_release_from_github" ]; postInstall = '' @@ -75,15 +85,22 @@ rustPlatform.buildRustPackage rec { } ''; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = "--version"; + doInstallCheck = true; + meta = { description = "Cross-platform application to monitor your network traffic with ease"; homepage = "https://github.com/gyulyvgc/sniffnet"; - changelog = "https://github.com/gyulyvgc/sniffnet/blob/v${version}/CHANGELOG.md"; + changelog = "https://github.com/gyulyvgc/sniffnet/blob/v${finalAttrs.version}/CHANGELOG.md"; license = with lib.licenses; [ mit # or asl20 ]; maintainers = with lib.maintainers; [ figsoda ]; + teams = [ lib.teams.ngi ]; mainProgram = "sniffnet"; }; -} +}) diff --git a/pkgs/by-name/sp/spirv-llvm-translator/package.nix b/pkgs/by-name/sp/spirv-llvm-translator/package.nix index 7fab99fbb4b6..7e5f850aa4d8 100644 --- a/pkgs/by-name/sp/spirv-llvm-translator/package.nix +++ b/pkgs/by-name/sp/spirv-llvm-translator/package.nix @@ -36,26 +36,6 @@ let rev = "v${version}"; hash = "sha256-rt3RTZut41uDEh0YmpOzH3sOezeEVWtAIGMKCHLSJBw="; }; - "17" = rec { - version = "17.0.15"; - rev = "v${version}"; - hash = "sha256-ETpTQYMMApECDfuRY87HrO/PUxZ13x9dBRJ3ychslUI="; - }; - "16" = rec { - version = "16.0.15"; - rev = "v${version}"; - hash = "sha256-30i73tGl+1KlP92XA0uxdMTydd9EtaQ4SZ0W1kdm1fQ="; - }; - "15" = rec { - version = "15.0.15"; - rev = "v${version}"; - hash = "sha256-kFVDS+qwoG1AXrZ8LytoiLVbZkTGR9sO+Wrq3VGgWNQ="; - }; - "14" = rec { - version = "14.0.14"; - rev = "v${version}"; - hash = "sha256-PW+5w93omLYPZXjRtU4BNY2ztZ86pcjgUQZkrktMq+4="; - }; }; branch = versions."${llvmMajor}" or (throw "Incompatible LLVM version ${llvmMajor}"); @@ -70,14 +50,8 @@ stdenv.mkDerivation { inherit (branch) rev hash; }; - patches = lib.optionals (llvmMajor == "14") [ - (fetchpatch { - # tries to install llvm-spirv into llvm nix store path - url = "https://github.com/KhronosGroup/SPIRV-LLVM-Translator/commit/cce9a2f130070d799000cac42fe24789d2b777ab.patch"; - revert = true; - hash = "sha256-GbFacttZRDCgA0jkUoFA4/B3EDn3etweKvM09OwICJ8="; - }) - ]; + # TODO: Remove. + patches = [ ]; nativeBuildInputs = [ pkg-config diff --git a/pkgs/by-name/wa/wavm/package.nix b/pkgs/by-name/wa/wavm/package.nix deleted file mode 100644 index d56fba46cb56..000000000000 --- a/pkgs/by-name/wa/wavm/package.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - lib, - llvmPackages_12, - fetchFromGitHub, - cmake, -}: - -llvmPackages_12.stdenv.mkDerivation (finalAttrs: { - pname = "wavm"; - version = "2022-05-14"; - - src = fetchFromGitHub { - owner = "WAVM"; - repo = "WAVM"; - rev = "nightly/${finalAttrs.version}"; - hash = "sha256-SHz+oOOkwvVZucJYFSyZc3MnOAy1VatspmZmOAXYAWA="; - }; - - nativeBuildInputs = [ - cmake - llvmPackages_12.llvm - ]; - - meta = with lib; { - description = "WebAssembly Virtual Machine"; - mainProgram = "wavm"; - homepage = "https://wavm.github.io"; - license = licenses.bsd3; - maintainers = with maintainers; [ ereslibre ]; - platforms = platforms.unix; - }; -}) diff --git a/pkgs/by-name/we/werf/package.nix b/pkgs/by-name/we/werf/package.nix index ec0177690ac3..ed07c3da5480 100644 --- a/pkgs/by-name/we/werf/package.nix +++ b/pkgs/by-name/we/werf/package.nix @@ -10,17 +10,17 @@ }: buildGoModule (finalAttrs: { pname = "werf"; - version = "2.47.4"; + version = "2.47.5"; src = fetchFromGitHub { owner = "werf"; repo = "werf"; tag = "v${finalAttrs.version}"; - hash = "sha256-V/RwHwPp1THlzFdMts5qt4Ueqcoxx932eMqgF6yiZpM="; + hash = "sha256-rr0jHeAz8gcKj1rUzL8BoDFvuVrZF1+3I7ruKIvt8Rw="; }; proxyVendor = true; - vendorHash = "sha256-kFaXOvJBp/QU0N2Jwq450G48O2GYgC2Pc+2bGK9rJ9g="; + vendorHash = "sha256-dULy4iLpp+wlvk8gdzLQTJ6reRI1YQ8//+EU7/U/Xkw="; subPackages = [ "cmd/werf" ]; diff --git a/pkgs/by-name/we/wezterm/package.nix b/pkgs/by-name/we/wezterm/package.nix index 493757e0ef3b..40aef733fa24 100644 --- a/pkgs/by-name/we/wezterm/package.nix +++ b/pkgs/by-name/we/wezterm/package.nix @@ -28,14 +28,14 @@ rustPlatform.buildRustPackage rec { pname = "wezterm"; - version = "0-unstable-2025-07-30"; + version = "0-unstable-2025-08-14"; src = fetchFromGitHub { - owner = "wez"; + owner = "wezterm"; repo = "wezterm"; - rev = "6a493f88fab06a792308e0c704790390fd3c6232"; + rev = "bf9a2aeebacec19fd07b55234d626f006b22d369"; fetchSubmodules = true; - hash = "sha256-ilDUBkXKo3N83ew3I+Ic48SBjraCs3OyjVXlTItX0mU="; + hash = "sha256-cD0r+TchRc/A+G3HMu2PjjPm8m7Ue7GpH9F/PlfJcKE="; }; postPatch = '' @@ -156,7 +156,7 @@ rustPlatform.buildRustPackage rec { meta = with lib; { description = "GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust"; - homepage = "https://wezfurlong.org/wezterm"; + homepage = "https://wezterm.org"; license = licenses.mit; mainProgram = "wezterm"; maintainers = with maintainers; [ diff --git a/pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix b/pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix index 819742643724..fd296dd49790 100644 --- a/pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix +++ b/pkgs/desktops/pantheon/desktop/elementary-greeter/default.nix @@ -20,6 +20,7 @@ gnome-settings-daemon, mutter, elementary-icon-theme, + elementary-settings-daemon, wingpanel-with-indicators, elementary-gtk-theme, nixos-artwork, @@ -33,13 +34,15 @@ stdenv.mkDerivation rec { pname = "elementary-greeter"; - version = "8.0.1"; + # To allow overriding last-session-type. + # nixpkgs-update: no auto update + version = "8.0.1-unstable-2025-09-14"; src = fetchFromGitHub { owner = "elementary"; repo = "greeter"; - rev = version; - sha256 = "sha256-T/tI8WRVbTLdolDYa98M2Vm26p0xhGiai74lXAlpQ8k="; + rev = "2461ad1be4a4d0e541879abe869cf8911f505215"; + hash = "sha256-rDlaL2KCm0tz73cwHLgNAD7Ddbn1QFJVa+Syh5eTfWo="; }; patches = [ @@ -65,6 +68,7 @@ stdenv.mkDerivation rec { buildInputs = [ accountsservice elementary-icon-theme + elementary-settings-daemon gala # for io.elementary.desktop.background gnome-desktop gnome-settings-daemon diff --git a/pkgs/desktops/xfce/applications/xfmpc/default.nix b/pkgs/desktops/xfce/applications/xfmpc/default.nix index 697ae6453a50..aba98e9c99b1 100644 --- a/pkgs/desktops/xfce/applications/xfmpc/default.nix +++ b/pkgs/desktops/xfce/applications/xfmpc/default.nix @@ -55,13 +55,13 @@ stdenv.mkDerivation (finalAttrs: { passthru.updateScript = gitUpdater { rev-prefix = "xfmpc-"; }; - meta = with lib; { + meta = { description = "MPD client written in GTK"; homepage = "https://docs.xfce.org/apps/xfmpc/start"; - changelog = "https://gitlab.xfce.org/apps/xfmpc/-/blob/xfmpc-${version}/NEWS"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ doronbehar ]; - teams = [ teams.xfce ]; + changelog = "https://gitlab.xfce.org/apps/xfmpc/-/blob/xfmpc-${finalAttrs.version}/NEWS"; + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ doronbehar ]; + teams = [ lib.teams.xfce ]; mainProgram = "xfmpc"; }; }) diff --git a/pkgs/development/compilers/cone/default.nix b/pkgs/development/compilers/cone/default.nix deleted file mode 100644 index 0e95fdbc6ae5..000000000000 --- a/pkgs/development/compilers/cone/default.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - llvmPackages, - lib, - fetchFromGitHub, - cmake, -}: - -llvmPackages.stdenv.mkDerivation rec { - pname = "cone"; - version = "unstable-2022-12-12"; - - src = fetchFromGitHub { - owner = "jondgoodwin"; - repo = pname; - rev = "698bd6afc75777eabbc8ef576d64d683c6a1c5ab"; - sha256 = "0y2s9xgkci8n72v6gnc1i7shr2y3g2sa8fbr25gpxa9ipiq9khg7"; - }; - - nativeBuildInputs = [ cmake ]; - - buildInputs = [ - llvmPackages.llvm - ]; - - # M68k is an experimental target, so not enabled by default - postPatch = '' - sed -i CMakeLists.txt \ - -e '/M68k/d' - ''; - - installPhase = '' - install -Dm755 conec $out/bin/conec - install -Dm644 libconestd.a $out/lib/libconestd.a - ''; - - meta = with lib; { - description = "Cone Programming Language"; - mainProgram = "conec"; - homepage = "https://cone.jondgoodwin.com"; - license = licenses.mit; - maintainers = with maintainers; [ ]; - platforms = platforms.all; - }; -} diff --git a/pkgs/development/compilers/fpc/default.nix b/pkgs/development/compilers/fpc/default.nix index c9df54eaf1f3..7ac3fc752443 100644 --- a/pkgs/development/compilers/fpc/default.nix +++ b/pkgs/development/compilers/fpc/default.nix @@ -111,5 +111,9 @@ stdenv.mkDerivation rec { lgpl2 ]; platforms = platforms.unix; + # See: + # * + # * + broken = stdenv.cc.isClang && stdenv.hostPlatform.isx86_64; }; } diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix index b8da2ef90501..778dfbf74fda 100644 --- a/pkgs/development/compilers/ghc/common-hadrian.nix +++ b/pkgs/development/compilers/ghc/common-hadrian.nix @@ -892,6 +892,8 @@ stdenv.mkDerivation ( timeout = 24 * 3600; platforms = lib.platforms.all; inherit (bootPkgs.ghc.meta) license; + # To be fixed by . + broken = useLLVM; }; dontStrip = targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm; diff --git a/pkgs/development/compilers/ghc/common-make-native-bignum.nix b/pkgs/development/compilers/ghc/common-make-native-bignum.nix index 776e636ec187..922875e6b4e1 100644 --- a/pkgs/development/compilers/ghc/common-make-native-bignum.nix +++ b/pkgs/development/compilers/ghc/common-make-native-bignum.nix @@ -672,6 +672,8 @@ stdenv.mkDerivation ( timeout = 24 * 3600; platforms = lib.platforms.all; inherit (bootPkgs.ghc.meta) license; + # To be fixed by . + broken = useLLVM; }; } diff --git a/pkgs/development/compilers/llvm/12/clang/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/clang/gnu-install-dirs.patch deleted file mode 100644 index b834d386b4eb..000000000000 --- a/pkgs/development/compilers/llvm/12/clang/gnu-install-dirs.patch +++ /dev/null @@ -1,235 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9e74014134a0..976e6a1757fd 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.13.4) - if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) - project(Clang) - -+ include(GNUInstallDirs) -+ - set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to") - set(CMAKE_CXX_STANDARD_REQUIRED YES) - set(CMAKE_CXX_EXTENSIONS NO) -@@ -416,7 +418,7 @@ include_directories(BEFORE - - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - install(DIRECTORY include/clang include/clang-c -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT clang-headers - FILES_MATCHING - PATTERN "*.def" -@@ -425,7 +427,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - ) - - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT clang-headers - FILES_MATCHING - PATTERN "CMakeFiles" EXCLUDE -@@ -445,7 +447,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - - add_custom_target(bash-autocomplete DEPENDS utils/bash-autocomplete.sh) - install(PROGRAMS utils/bash-autocomplete.sh -- DESTINATION share/clang -+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang - COMPONENT bash-autocomplete) - if(NOT LLVM_ENABLE_IDE) - add_llvm_install_targets(install-bash-autocomplete -diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake -index 704278a0e93b..d25c8d325c71 100644 ---- a/cmake/modules/AddClang.cmake -+++ b/cmake/modules/AddClang.cmake -@@ -123,9 +123,9 @@ macro(add_clang_library name) - install(TARGETS ${lib} - COMPONENT ${lib} - ${export_to_clangtargets} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} -- RUNTIME DESTINATION bin) -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - - if (NOT LLVM_ENABLE_IDE) - add_llvm_install_targets(install-${lib} -@@ -170,7 +170,7 @@ macro(add_clang_tool name) - - install(TARGETS ${name} - ${export_to_clangtargets} -- RUNTIME DESTINATION bin -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT ${name}) - - if(NOT LLVM_ENABLE_IDE) -@@ -185,7 +185,7 @@ endmacro() - macro(add_clang_symlink name dest) - add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) - # Always generate install targets -- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) -+ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) - endmacro() - - function(clang_target_link_libraries target type) -diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt -index b2c0ce8dd4a0..19e5443d8c25 100644 ---- a/lib/Headers/CMakeLists.txt -+++ b/lib/Headers/CMakeLists.txt -@@ -215,7 +215,7 @@ set_target_properties(clang-resource-headers PROPERTIES - FOLDER "Misc" - RUNTIME_OUTPUT_DIRECTORY "${output_dir}") - --set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) -+set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) - - install( - FILES ${files} ${generated_files} -diff --git a/tools/c-index-test/CMakeLists.txt b/tools/c-index-test/CMakeLists.txt -index ceef4b08637c..8efad5520ca4 100644 ---- a/tools/c-index-test/CMakeLists.txt -+++ b/tools/c-index-test/CMakeLists.txt -@@ -54,7 +54,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH - "@executable_path/../../lib") - else() -- set(INSTALL_DESTINATION bin) -+ set(INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif() - - install(TARGETS c-index-test -diff --git a/tools/clang-format/CMakeLists.txt b/tools/clang-format/CMakeLists.txt -index 35ecdb11253c..d77d75de0094 100644 ---- a/tools/clang-format/CMakeLists.txt -+++ b/tools/clang-format/CMakeLists.txt -@@ -21,20 +21,20 @@ if( LLVM_LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE ) - endif() - - install(PROGRAMS clang-format-bbedit.applescript -- DESTINATION share/clang -+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang - COMPONENT clang-format) - install(PROGRAMS clang-format-diff.py -- DESTINATION share/clang -+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang - COMPONENT clang-format) - install(PROGRAMS clang-format-sublime.py -- DESTINATION share/clang -+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang - COMPONENT clang-format) - install(PROGRAMS clang-format.el -- DESTINATION share/clang -+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang - COMPONENT clang-format) - install(PROGRAMS clang-format.py -- DESTINATION share/clang -+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang - COMPONENT clang-format) - install(PROGRAMS git-clang-format -- DESTINATION bin -+ DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT clang-format) -diff --git a/tools/clang-rename/CMakeLists.txt b/tools/clang-rename/CMakeLists.txt -index cda8e29ec5b1..0134d8ccd70b 100644 ---- a/tools/clang-rename/CMakeLists.txt -+++ b/tools/clang-rename/CMakeLists.txt -@@ -19,8 +19,8 @@ clang_target_link_libraries(clang-rename - ) - - install(PROGRAMS clang-rename.py -- DESTINATION share/clang -+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang - COMPONENT clang-rename) - install(PROGRAMS clang-rename.el -- DESTINATION share/clang -+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang - COMPONENT clang-rename) -diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt -index 51ff2e7e1565..1ed5f8a079a1 100644 ---- a/tools/libclang/CMakeLists.txt -+++ b/tools/libclang/CMakeLists.txt -@@ -166,7 +166,7 @@ endif() - if(INTERNAL_INSTALL_PREFIX) - set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include") - else() -- set(LIBCLANG_HEADERS_INSTALL_DESTINATION include) -+ set(LIBCLANG_HEADERS_INSTALL_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - endif() - - install(DIRECTORY ../../include/clang-c -@@ -196,7 +196,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS}) - COMPONENT - libclang-python-bindings - DESTINATION -- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") -+ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") - endforeach() - if(NOT LLVM_ENABLE_IDE) - add_custom_target(libclang-python-bindings) -diff --git a/tools/scan-build/CMakeLists.txt b/tools/scan-build/CMakeLists.txt -index ec0702d76f18..d25d982f51da 100644 ---- a/tools/scan-build/CMakeLists.txt -+++ b/tools/scan-build/CMakeLists.txt -@@ -47,7 +47,7 @@ if(CLANG_INSTALL_SCANBUILD) - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) - list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) - install(PROGRAMS bin/${BinFile} -- DESTINATION bin -+ DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT scan-build) - endforeach() - -@@ -61,7 +61,7 @@ if(CLANG_INSTALL_SCANBUILD) - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile}) - list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile}) - install(PROGRAMS libexec/${LibexecFile} -- DESTINATION libexec -+ DESTINATION ${CMAKE_INSTALL_LIBEXECDIR} - COMPONENT scan-build) - endforeach() - -@@ -89,7 +89,7 @@ if(CLANG_INSTALL_SCANBUILD) - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile}) - list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile}) - install(FILES share/scan-build/${ShareFile} -- DESTINATION share/scan-build -+ DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-build - COMPONENT scan-build) - endforeach() - -diff --git a/tools/scan-view/CMakeLists.txt b/tools/scan-view/CMakeLists.txt -index dd3d33439299..fea19c12ce70 100644 ---- a/tools/scan-view/CMakeLists.txt -+++ b/tools/scan-view/CMakeLists.txt -@@ -19,7 +19,7 @@ if(CLANG_INSTALL_SCANVIEW) - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) - list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) - install(PROGRAMS bin/${BinFile} -- DESTINATION bin -+ DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT scan-view) - endforeach() - -@@ -33,7 +33,7 @@ if(CLANG_INSTALL_SCANVIEW) - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/${ShareFile}) - list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ShareFile}) - install(FILES share/${ShareFile} -- DESTINATION share/scan-view -+ DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-view - COMPONENT scan-view) - endforeach() - -diff --git a/utils/hmaptool/CMakeLists.txt b/utils/hmaptool/CMakeLists.txt -index 62f2de0cb15c..6aa66825b6ec 100644 ---- a/utils/hmaptool/CMakeLists.txt -+++ b/utils/hmaptool/CMakeLists.txt -@@ -10,7 +10,7 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HM - - list(APPEND Depends ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HMAPTOOL}) - install(PROGRAMS ${CLANG_HMAPTOOL} -- DESTINATION bin -+ DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT hmaptool) - - add_custom_target(hmaptool ALL DEPENDS ${Depends}) diff --git a/pkgs/development/compilers/llvm/12/clang/purity.patch b/pkgs/development/compilers/llvm/12/clang/purity.patch deleted file mode 100644 index deb230a36c5b..000000000000 --- a/pkgs/development/compilers/llvm/12/clang/purity.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 4add81bba40dcec62c4ea4481be8e35ac53e89d8 Mon Sep 17 00:00:00 2001 -From: Will Dietz -Date: Thu, 18 May 2017 11:56:12 -0500 -Subject: [PATCH] "purity" patch for 5.0 - ---- - lib/Driver/ToolChains/Gnu.cpp | 7 ------- - 1 file changed, 7 deletions(-) - -diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp -index fe3c0191bb..c6a482bece 100644 ---- a/lib/Driver/ToolChains/Gnu.cpp -+++ b/lib/Driver/ToolChains/Gnu.cpp -@@ -487,12 +487,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, - if (!IsStatic) { - if (Args.hasArg(options::OPT_rdynamic)) - CmdArgs.push_back("-export-dynamic"); -- -- if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE) { -- CmdArgs.push_back("-dynamic-linker"); -- CmdArgs.push_back(Args.MakeArgString(Twine(D.DyldPrefix) + -- ToolChain.getDynamicLinker(Args))); -- } - } - - CmdArgs.push_back("-o"); --- -2.11.0 diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/X86-support-extension.patch b/pkgs/development/compilers/llvm/12/compiler-rt/X86-support-extension.patch deleted file mode 100644 index 66742e5b1498..000000000000 --- a/pkgs/development/compilers/llvm/12/compiler-rt/X86-support-extension.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt -index 3a66dd9c3fb..7efc85d9f9f 100644 ---- a/lib/builtins/CMakeLists.txt -+++ b/lib/builtins/CMakeLists.txt -@@ -345,4 +345,8 @@ if (NOT MSVC) - -+ set(i486_SOURCES ${i386_SOURCES}) -+ set(i586_SOURCES ${i386_SOURCES}) -+ set(i686_SOURCES ${i386_SOURCES}) -+ - if (WIN32) - set(i386_SOURCES - ${i386_SOURCES} -@@ -608,6 +612,7 @@ else () - endif() - - foreach (arch ${BUILTIN_SUPPORTED_ARCH}) -+ message("arch: ${arch}") - if (CAN_TARGET_${arch}) - # For ARM archs, exclude any VFP builtins if VFP is not supported - if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em)$") diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/armv7l.patch b/pkgs/development/compilers/llvm/12/compiler-rt/armv7l.patch deleted file mode 100644 index 120cfe6feb2a..000000000000 --- a/pkgs/development/compilers/llvm/12/compiler-rt/armv7l.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff -ur compiler-rt-10.0.0.src/cmake/builtin-config-ix.cmake compiler-rt-10.0.0.src-patched/cmake/builtin-config-ix.cmake ---- compiler-rt-10.0.0.src/cmake/builtin-config-ix.cmake 2020-03-24 00:01:02.000000000 +0900 -+++ compiler-rt-10.0.0.src-patched/cmake/builtin-config-ix.cmake 2020-05-10 03:42:00.883450706 +0900 -@@ -24,7 +24,7 @@ - - - set(ARM64 aarch64) --set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k) -+set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l) - set(HEXAGON hexagon) - set(X86 i386) - set(X86_64 x86_64) -diff -ur compiler-rt-10.0.0.src/lib/builtins/CMakeLists.txt compiler-rt-10.0.0.src-patched/lib/builtins/CMakeLists.txt ---- compiler-rt-10.0.0.src/lib/builtins/CMakeLists.txt 2020-03-24 00:01:02.000000000 +0900 -+++ compiler-rt-10.0.0.src-patched/lib/builtins/CMakeLists.txt 2020-05-10 03:44:49.468579650 +0900 -@@ -474,6 +474,7 @@ - set(armv7_SOURCES ${arm_SOURCES}) - set(armv7s_SOURCES ${arm_SOURCES}) - set(armv7k_SOURCES ${arm_SOURCES}) -+set(armv7l_SOURCES ${arm_SOURCES}) - set(arm64_SOURCES ${aarch64_SOURCES}) - - # macho_embedded archs -@@ -595,7 +596,7 @@ - foreach (arch ${BUILTIN_SUPPORTED_ARCH}) - if (CAN_TARGET_${arch}) - # For ARM archs, exclude any VFP builtins if VFP is not supported -- if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em)$") -+ if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em)$") - string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}") - check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP) - if(NOT COMPILER_RT_HAS_${arch}_VFP) diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/codesign.patch b/pkgs/development/compilers/llvm/12/compiler-rt/codesign.patch deleted file mode 100644 index 3cc12b94b200..000000000000 --- a/pkgs/development/compilers/llvm/12/compiler-rt/codesign.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 3dec5f3475a26aeb4678627795c4b67c6b7b4785 Mon Sep 17 00:00:00 2001 -From: Will Dietz -Date: Tue, 19 Sep 2017 13:13:06 -0500 -Subject: [PATCH] remove codesign use on Apple, disable ios sim testing that - needs it - ---- - cmake/Modules/AddCompilerRT.cmake | 8 ------ - test/asan/CMakeLists.txt | 52 --------------------------------------- - test/tsan/CMakeLists.txt | 47 ----------------------------------- - 3 files changed, 107 deletions(-) - -diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake -index bc5fb9ff7..b64eb4246 100644 ---- a/cmake/Modules/AddCompilerRT.cmake -+++ b/cmake/Modules/AddCompilerRT.cmake -@@ -210,14 +210,6 @@ function(add_compiler_rt_runtime name type) - set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "") - set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib") - endif() -- if(APPLE) -- # Ad-hoc sign the dylibs -- add_custom_command(TARGET ${libname} -- POST_BUILD -- COMMAND codesign --sign - $ -- WORKING_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR} -- ) -- endif() - endif() - install(TARGETS ${libname} - ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} -2.14.1 - diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch deleted file mode 100644 index 5f025764de1c..000000000000 --- a/pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b44ad2c2118e..d42f5664d448 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -8,6 +8,7 @@ cmake_minimum_required(VERSION 3.13.4) - # Check if compiler-rt is built as a standalone project. - if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) - project(CompilerRT C CXX ASM) -+ include(GNUInstallDirs) - set(COMPILER_RT_STANDALONE_BUILD TRUE) - set_property(GLOBAL PROPERTY USE_FOLDERS ON) - endif() -diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake -index 361538a58e47..f0d8d9ab80f1 100644 ---- a/cmake/Modules/AddCompilerRT.cmake -+++ b/cmake/Modules/AddCompilerRT.cmake -@@ -495,7 +495,7 @@ macro(add_compiler_rt_resource_file target_name file_name component) - add_custom_target(${target_name} DEPENDS ${dst_file}) - # Install in Clang resource directory. - install(FILES ${file_name} -- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR} - COMPONENT ${component}) - add_dependencies(${component} ${target_name}) - -@@ -512,7 +512,7 @@ macro(add_compiler_rt_script name) - add_custom_target(${name} DEPENDS ${dst}) - install(FILES ${dst} - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE -- DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin) -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_BINDIR}) - endmacro(add_compiler_rt_script src name) - - # Builds custom version of libc++ and installs it in . -diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake -index 456a8dcda59f..7a09e74c7c79 100644 ---- a/cmake/Modules/CompilerRTDarwinUtils.cmake -+++ b/cmake/Modules/CompilerRTDarwinUtils.cmake -@@ -508,7 +508,7 @@ macro(darwin_add_embedded_builtin_libraries) - set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR - ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded) - set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR -- ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded) -+ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/macho_embedded) - - set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi") - set(CFLAGS_i386 "-march=pentium") -diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake -index f61d487e93a0..f1f46fb9599c 100644 ---- a/cmake/Modules/CompilerRTUtils.cmake -+++ b/cmake/Modules/CompilerRTUtils.cmake -@@ -378,7 +378,7 @@ endfunction() - function(get_compiler_rt_install_dir arch install_dir) - if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) - get_compiler_rt_target(${arch} target) -- set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/lib/${target} PARENT_SCOPE) -+ set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${target} PARENT_SCOPE) - else() - set(${install_dir} ${COMPILER_RT_LIBRARY_INSTALL_DIR} PARENT_SCOPE) - endif() -diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake -index 1edab43e7c0d..1aac6b73ff82 100644 ---- a/cmake/base-config-ix.cmake -+++ b/cmake/base-config-ix.cmake -@@ -65,11 +65,11 @@ if (LLVM_TREE_AVAILABLE) - else() - # Take output dir and install path from the user. - set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH -- "Path where built compiler-rt libraries should be stored.") -+ "Path where built compiler-rt build artifacts should be stored.") - set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH - "Path where built compiler-rt executables should be stored.") -- set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH -- "Path where built compiler-rt libraries should be installed.") -+ set(COMPILER_RT_INSTALL_PATH "" CACHE PATH -+ "Prefix where built compiler-rt artifacts should be installed, comes before CMAKE_INSTALL_PREFIX.") - option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF) - option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) - # Use a host compiler to compile/link tests. -@@ -97,7 +97,7 @@ else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR) - set(COMPILER_RT_LIBRARY_OUTPUT_DIR - ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) - set(COMPILER_RT_LIBRARY_INSTALL_DIR -- ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR}) -+ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR}) - endif() - - if(APPLE) -diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt -index b00e8caa1ddd..0fe64e4862c9 100644 ---- a/include/CMakeLists.txt -+++ b/include/CMakeLists.txt -@@ -69,22 +69,22 @@ set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc") - install(FILES ${SANITIZER_HEADERS} - COMPONENT compiler-rt-headers - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ -- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer) -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/sanitizer) - # Install fuzzer headers. - install(FILES ${FUZZER_HEADERS} - COMPONENT compiler-rt-headers - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ -- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/fuzzer) -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/fuzzer) - # Install xray headers. - install(FILES ${XRAY_HEADERS} - COMPONENT compiler-rt-headers - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ -- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray) -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/xray) - # Install profile headers. - install(FILES ${PROFILE_HEADERS} - COMPONENT compiler-rt-headers - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ -- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/profile) -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/profile) - - if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs. - add_custom_target(install-compiler-rt-headers -diff --git a/lib/dfsan/CMakeLists.txt b/lib/dfsan/CMakeLists.txt -index a29de8deff1b..d39ff01613d2 100644 ---- a/lib/dfsan/CMakeLists.txt -+++ b/lib/dfsan/CMakeLists.txt -@@ -57,4 +57,4 @@ add_custom_command(OUTPUT ${dfsan_abilist_filename} - DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt) - add_dependencies(dfsan dfsan_abilist) - install(FILES ${dfsan_abilist_filename} -- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share) -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR}) diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/normalize-var.patch b/pkgs/development/compilers/llvm/12/compiler-rt/normalize-var.patch deleted file mode 100644 index 135cf625ef78..000000000000 --- a/pkgs/development/compilers/llvm/12/compiler-rt/normalize-var.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake -index f1f46fb9599c..6f19e69507ba 100644 ---- a/cmake/Modules/CompilerRTUtils.cmake -+++ b/cmake/Modules/CompilerRTUtils.cmake -@@ -302,8 +302,9 @@ macro(load_llvm_config) - # Get some LLVM variables from LLVMConfig. - include("${LLVM_CMAKE_PATH}/LLVMConfig.cmake") - -- set(LLVM_LIBRARY_OUTPUT_INTDIR -- ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) -+ get_filename_component(LLVM_LIBRARY_OUTPUT_INTDIR -+ ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX} -+ REALPATH) - endif() - endmacro() - diff --git a/pkgs/development/compilers/llvm/12/libunwind/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/libunwind/gnu-install-dirs.patch deleted file mode 100644 index a791d6c43231..000000000000 --- a/pkgs/development/compilers/llvm/12/libunwind/gnu-install-dirs.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 48cb8e004e08..fec8144fb95a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -23,6 +23,8 @@ set(LIBUNWIND_LIBCXX_PATH "${CMAKE_CURRENT_LIST_DIR}/../libcxx" CACHE PATH - if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBUNWIND_STANDALONE_BUILD) - project(libunwind LANGUAGES C CXX ASM) - -+ include(GNUInstallDirs) -+ - set(PACKAGE_NAME libunwind) - set(PACKAGE_VERSION 12.0.0) - set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") -@@ -115,17 +117,17 @@ set(CMAKE_MODULE_PATH - - if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) - set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) -- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) -+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) - if(LIBCXX_LIBDIR_SUBDIR) - string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) - string(APPEND LIBUNWIND_INSTALL_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) - endif() - elseif(LLVM_LIBRARY_OUTPUT_INTDIR) - set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) -- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX}) -+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX}) - else() - set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX}) -- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX}) -+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX}) - endif() - - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBUNWIND_LIBRARY_DIR}) diff --git a/pkgs/development/compilers/llvm/12/lld/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/lld/gnu-install-dirs.patch deleted file mode 100644 index 61e2f0e48653..000000000000 --- a/pkgs/development/compilers/llvm/12/lld/gnu-install-dirs.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d4e561b50d8f..cfa5bdd79c2a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -6,6 +6,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(LLD_BUILT_STANDALONE TRUE) - -+ include(GNUInstallDirs) -+ - find_program(LLVM_CONFIG_PATH "llvm-config" DOC "Path to llvm-config binary") - if(NOT LLVM_CONFIG_PATH) - message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH") -@@ -179,7 +181,7 @@ include_directories(BEFORE - - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - install(DIRECTORY include/ -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING - PATTERN "*.h" - ) -diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake -index 23df41312403..d62372c88de7 100644 ---- a/cmake/modules/AddLLD.cmake -+++ b/cmake/modules/AddLLD.cmake -@@ -20,9 +20,9 @@ macro(add_lld_library name) - install(TARGETS ${name} - COMPONENT ${name} - ${export_to_lldtargets} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} -- RUNTIME DESTINATION bin) -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - - if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) - add_llvm_install_targets(install-${name} -@@ -54,7 +54,7 @@ macro(add_lld_tool name) - - install(TARGETS ${name} - ${export_to_lldtargets} -- RUNTIME DESTINATION bin -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT ${name}) - - if(NOT CMAKE_CONFIGURATION_TYPES) -@@ -69,5 +69,5 @@ endmacro() - macro(add_lld_symlink name dest) - add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) - # Always generate install targets -- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) -+ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) - endmacro() -diff --git a/tools/lld/CMakeLists.txt b/tools/lld/CMakeLists.txt -index 5cff736ff57f..64e775c771b9 100644 ---- a/tools/lld/CMakeLists.txt -+++ b/tools/lld/CMakeLists.txt -@@ -21,7 +21,7 @@ target_link_libraries(lld - ) - - install(TARGETS lld -- RUNTIME DESTINATION bin) -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - - if(NOT LLD_SYMLINKS_TO_CREATE) - set(LLD_SYMLINKS_TO_CREATE diff --git a/pkgs/development/compilers/llvm/12/lldb/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/lldb/gnu-install-dirs.patch deleted file mode 100644 index 9a4d2b272acb..000000000000 --- a/pkgs/development/compilers/llvm/12/lldb/gnu-install-dirs.patch +++ /dev/null @@ -1,110 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b5633e21c56a..f2f1035e9238 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -10,6 +10,8 @@ set(CMAKE_MODULE_PATH - # If we are not building as part of LLVM, build LLDB as a standalone project, - # using LLVM as an external library. - if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) -+ include(GNUInstallDirs) -+ - project(lldb) - include(LLDBStandalone) - -diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake -index 4ed5c647c5d2..89f96e710d55 100644 ---- a/cmake/modules/AddLLDB.cmake -+++ b/cmake/modules/AddLLDB.cmake -@@ -107,13 +107,13 @@ function(add_lldb_library name) - endif() - - if(PARAM_SHARED) -- set(install_dest lib${LLVM_LIBDIR_SUFFIX}) -+ set(install_dest ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) - if(PARAM_INSTALL_PREFIX) - set(install_dest ${PARAM_INSTALL_PREFIX}) - endif() - # RUNTIME is relevant for DLL platforms, FRAMEWORK for macOS - install(TARGETS ${name} COMPONENT ${name} -- RUNTIME DESTINATION bin -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${install_dest} - ARCHIVE DESTINATION ${install_dest} - FRAMEWORK DESTINATION ${install_dest}) -diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake -index 2fdf1502d055..37364341ff8b 100644 ---- a/cmake/modules/LLDBConfig.cmake -+++ b/cmake/modules/LLDBConfig.cmake -@@ -225,7 +225,7 @@ include_directories(BEFORE - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - install(DIRECTORY include/ - COMPONENT lldb-headers -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING - PATTERN "*.h" - PATTERN ".cmake" EXCLUDE -@@ -233,7 +233,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ - COMPONENT lldb-headers -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING - PATTERN "*.h" - PATTERN ".cmake" EXCLUDE -diff --git a/tools/intel-features/CMakeLists.txt b/tools/intel-features/CMakeLists.txt -index 734167e51bc5..f95761b5df58 100644 ---- a/tools/intel-features/CMakeLists.txt -+++ b/tools/intel-features/CMakeLists.txt -@@ -65,4 +65,4 @@ if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT) - endif() - - install(TARGETS lldbIntelFeatures -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}) -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) -diff --git a/cmake/modules/LLDBStandalone.cmake b/cmake/modules/LLDBStandalone.cmake -index 752113b..010f187 100644 ---- a/cmake/modules/LLDBStandalone.cmake -+++ b/cmake/modules/LLDBStandalone.cmake -@@ -62,7 +62,7 @@ endif() - - # They are used as destination of target generators. - set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) --set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) -+set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) - if(WIN32 OR CYGWIN) - # DLL platform -- put DLLs into bin. - set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b5633e2..86e4738 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -79,7 +79,7 @@ if (LLDB_ENABLE_PYTHON) - if(LLDB_BUILD_FRAMEWORK) - set(lldb_python_target_dir "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Python/lldb") - else() -- set(lldb_python_target_dir "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb") -+ set(lldb_python_target_dir "${CMAKE_INSTALL_LIBDIR}/../${LLDB_PYTHON_RELATIVE_PATH}/lldb") - endif() - get_target_property(lldb_python_bindings_dir swig_wrapper_python BINARY_DIR) - finish_swig_python("lldb-python" "${lldb_python_bindings_dir}" "${lldb_python_target_dir}") -diff --git a/source/API/CMakeLists.txt b/source/API/CMakeLists.txt -index b5633e2..86e4738 100644 ---- a/source/API/CMakeLists.txt 2024-05-30 19:08:14.241656491 -0700 -+++ b/source/API/CMakeLists.txt 2024-05-30 19:08:48.218219667 -0700 -@@ -113,14 +113,6 @@ - ${option_install_prefix} - ) - --# lib/pythonX.Y/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so, --# which depends on lib/libLLVM*.so (BUILD_SHARED_LIBS) or lib/libLLVM-10git.so --# (LLVM_LINK_LLVM_DYLIB). Add an additional rpath $ORIGIN/../../../../lib so --# that _lldb.so can be loaded from Python. --if(LLDB_ENABLE_PYTHON AND (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB) AND UNIX AND NOT APPLE) -- set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "\$ORIGIN/../../../../lib${LLVM_LIBDIR_SUFFIX}") --endif() -- - if(Python3_RPATH) - set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "${Python3_RPATH}") - set_property(TARGET liblldb APPEND PROPERTY BUILD_RPATH "${Python3_RPATH}") diff --git a/pkgs/development/compilers/llvm/12/lldb/procfs.patch b/pkgs/development/compilers/llvm/12/lldb/procfs.patch deleted file mode 100644 index b075dbaeee0a..000000000000 --- a/pkgs/development/compilers/llvm/12/lldb/procfs.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/source/Plugins/Process/Linux/Procfs.h -+++ b/source/Plugins/Process/Linux/Procfs.h -@@ -11,21 +11,12 @@ - // sys/procfs.h on Android/Linux for all supported architectures. - - #include -+#include - --#ifdef __ANDROID__ --#if defined(__arm64__) || defined(__aarch64__) --typedef unsigned long elf_greg_t; --typedef elf_greg_t -- elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))]; --typedef struct user_fpsimd_state elf_fpregset_t; --#ifndef NT_FPREGSET --#define NT_FPREGSET NT_PRFPREG --#endif // NT_FPREGSET --#elif defined(__mips__) --#ifndef NT_FPREGSET --#define NT_FPREGSET NT_PRFPREG --#endif // NT_FPREGSET --#endif --#else // __ANDROID__ -+#if !defined(__GLIBC__) && defined(__powerpc__) -+#define pt_regs musl_pt_regs -+#include -+#undef pt_regs -+#else - #include --#endif // __ANDROID__ -+#endif diff --git a/pkgs/development/compilers/llvm/12/lldb/resource-dir.patch b/pkgs/development/compilers/llvm/12/lldb/resource-dir.patch deleted file mode 100644 index e0db80afeb9f..000000000000 --- a/pkgs/development/compilers/llvm/12/lldb/resource-dir.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake -index 37364341ff8b..7f74c1a3e257 100644 ---- a/cmake/modules/LLDBConfig.cmake -+++ b/cmake/modules/LLDBConfig.cmake -@@ -257,7 +257,7 @@ if (NOT TARGET clang-resource-headers) - # Iterate over the possible places where the external resource directory - # could be and pick the first that exists. - foreach(CANDIDATE "${Clang_DIR}/../.." "${LLVM_DIR}" "${LLVM_LIBRARY_DIRS}" -- "${LLVM_BUILD_LIBRARY_DIR}" -+ "${LLVM_BUILD_LIBRARY_DIR}" "@clangLibDir@" - "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}") - # Build the resource directory path by appending 'clang/'. - set(CANDIDATE_RESOURCE_DIR "${CANDIDATE}/clang/${LLDB_CLANG_RESOURCE_DIR_NAME}") diff --git a/pkgs/development/compilers/llvm/12/llvm/fix-llvm-issue-49955.patch b/pkgs/development/compilers/llvm/12/llvm/fix-llvm-issue-49955.patch deleted file mode 100644 index b515583a0c42..000000000000 --- a/pkgs/development/compilers/llvm/12/llvm/fix-llvm-issue-49955.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/lib/CodeGen/AsmPrinter/CMakeLists.txt b/lib/CodeGen/AsmPrinter/CMakeLists.txt -index eb924282..c77c140b 100644 ---- a/lib/CodeGen/AsmPrinter/CMakeLists.txt -+++ b/lib/CodeGen/AsmPrinter/CMakeLists.txt -@@ -44,3 +44,8 @@ add_llvm_component_library(LLVMAsmPrinter - Support - Target - ) -+ -+if (CMAKE_COMPILER_IS_GNUCXX) -+ set_source_files_properties(DwarfCompileUnit.cpp PROPERTIES -+ COMPILE_FLAGS -fno-strict-aliasing) -+endif() diff --git a/pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs-polly.patch b/pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs-polly.patch deleted file mode 100644 index 68f3c45396f6..000000000000 --- a/pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs-polly.patch +++ /dev/null @@ -1,105 +0,0 @@ -diff --git a/tools/polly/CMakeLists.txt b/tools/polly/CMakeLists.txt -index ca7c04c565bb..6ed5db5dd4f8 100644 ---- a/tools/polly/CMakeLists.txt -+++ b/tools/polly/CMakeLists.txt -@@ -2,7 +2,11 @@ - if (NOT DEFINED LLVM_MAIN_SRC_DIR) - project(Polly) - cmake_minimum_required(VERSION 3.13.4) -+endif() -+ -+include(GNUInstallDirs) - -+if (NOT DEFINED LLVM_MAIN_SRC_DIR) - # Where is LLVM installed? - find_package(LLVM CONFIG REQUIRED) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) -@@ -122,13 +126,13 @@ include_directories( - - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - install(DIRECTORY include/ -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING - PATTERN "*.h" - ) - - install(DIRECTORY ${POLLY_BINARY_DIR}/include/ -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING - PATTERN "*.h" - PATTERN "CMakeFiles" EXCLUDE -diff --git a/tools/polly/cmake/CMakeLists.txt b/tools/polly/cmake/CMakeLists.txt -index 7cc129ba2e90..137be25e4b80 100644 ---- a/tools/polly/cmake/CMakeLists.txt -+++ b/tools/polly/cmake/CMakeLists.txt -@@ -79,18 +79,18 @@ file(GENERATE - - # Generate PollyConfig.cmake for the install tree. - unset(POLLY_EXPORTS) --set(POLLY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") -+set(POLLY_INSTALL_PREFIX "") - set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") --set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") --set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}") -+set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") -+set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") - if (POLLY_BUNDLED_ISL) - set(POLLY_CONFIG_INCLUDE_DIRS -- "${POLLY_INSTALL_PREFIX}/include" -- "${POLLY_INSTALL_PREFIX}/include/polly" -+ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}" -+ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}/polly" - ) - else() - set(POLLY_CONFIG_INCLUDE_DIRS -- "${POLLY_INSTALL_PREFIX}/include" -+ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_INCLUDEDIR}" - ${ISL_INCLUDE_DIRS} - ) - endif() -@@ -100,12 +100,12 @@ endif() - foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS) - get_target_property(tgt_type ${tgt} TYPE) - if (tgt_type STREQUAL "EXECUTABLE") -- set(tgt_prefix "bin/") -+ set(tgt_prefix "${CMAKE_INSTALL_BINDIR}/") - else() -- set(tgt_prefix "lib/") -+ set(tgt_prefix "${CMAKE_INSTALL_LIBDIR}/") - endif() - -- set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$") -+ set(tgt_path "${tgt_prefix}$") - file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path}) - - if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY") -diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake -index 518a09b45a42..bd9d6f5542ad 100644 ---- a/tools/polly/cmake/polly_macros.cmake -+++ b/tools/polly/cmake/polly_macros.cmake -@@ -44,8 +44,8 @@ macro(add_polly_library name) - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly") - install(TARGETS ${name} - EXPORT LLVMExports -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) - endif() - set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) - endmacro(add_polly_library) -diff --git a/tools/polly/lib/External/CMakeLists.txt b/tools/polly/lib/External/CMakeLists.txt -index 8991094d92c7..178d8ad606bb 100644 ---- a/tools/polly/lib/External/CMakeLists.txt -+++ b/tools/polly/lib/External/CMakeLists.txt -@@ -275,7 +275,7 @@ if (POLLY_BUNDLED_ISL) - install(DIRECTORY - ${ISL_SOURCE_DIR}/include/ - ${ISL_BINARY_DIR}/include/ -- DESTINATION include/polly -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/polly - FILES_MATCHING - PATTERN "*.h" - PATTERN "CMakeFiles" EXCLUDE diff --git a/pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs.patch deleted file mode 100644 index da8dc1445171..000000000000 --- a/pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs.patch +++ /dev/null @@ -1,417 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 277d0fe54d7b..af69c8be8745 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -256,15 +256,21 @@ if (CMAKE_BUILD_TYPE AND - message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") - endif() - -+include(GNUInstallDirs) -+ - set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) - --set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')") -+set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING -+ "Path for binary subdirectory (defaults to 'bin')") - mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) - - set(LLVM_UTILS_INSTALL_DIR "${LLVM_TOOLS_INSTALL_DIR}" CACHE STRING - "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)") - mark_as_advanced(LLVM_UTILS_INSTALL_DIR) - -+set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING -+ "Path for CMake subdirectory (defaults to lib/cmake/llvm)" ) -+ - # They are used as destination of target generators. - set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) - set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) -@@ -567,9 +573,9 @@ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF) - option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON) - option (LLVM_ENABLE_BINDINGS "Build bindings." ON) - --set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html" -+set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html" - CACHE STRING "Doxygen-generated HTML documentation install directory") --set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html" -+set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html" - CACHE STRING "OCamldoc-generated HTML documentation install directory") - - option (LLVM_BUILD_EXTERNAL_COMPILER_RT -@@ -1027,7 +1033,7 @@ endif() - - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - install(DIRECTORY include/llvm include/llvm-c -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT llvm-headers - FILES_MATCHING - PATTERN "*.def" -@@ -1038,7 +1044,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - ) - - install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm ${LLVM_INCLUDE_DIR}/llvm-c -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT llvm-headers - FILES_MATCHING - PATTERN "*.def" -@@ -1052,13 +1058,13 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - - if (LLVM_INSTALL_MODULEMAPS) - install(DIRECTORY include/llvm include/llvm-c -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT llvm-headers - FILES_MATCHING - PATTERN "module.modulemap" - ) - install(FILES include/llvm/module.install.modulemap -- DESTINATION include/llvm -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm - COMPONENT llvm-headers - RENAME "module.extern.modulemap" - ) -diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake -index 97c9980c7de3..409e8b615f75 100644 ---- a/cmake/modules/AddLLVM.cmake -+++ b/cmake/modules/AddLLVM.cmake -@@ -804,9 +804,9 @@ macro(add_llvm_library name) - - install(TARGETS ${name} - ${export_to_llvmexports} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -- RUNTIME DESTINATION bin COMPONENT ${name}) -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${name}) - - if (NOT LLVM_ENABLE_IDE) - add_llvm_install_targets(install-${name} -@@ -1022,7 +1022,7 @@ function(process_llvm_pass_plugins) - "set(LLVM_STATIC_EXTENSIONS ${LLVM_STATIC_EXTENSIONS})") - install(FILES - ${llvm_cmake_builddir}/LLVMConfigExtensions.cmake -- DESTINATION ${LLVM_INSTALL_PACKAGE_DIR} -+ DESTINATION ${LLVM_INSTALL_CMAKE_DIR} - COMPONENT cmake-exports) - - set(ExtensionDef "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def") -@@ -1242,7 +1242,7 @@ macro(add_llvm_example name) - endif() - add_llvm_executable(${name} ${ARGN}) - if( LLVM_BUILD_EXAMPLES ) -- install(TARGETS ${name} RUNTIME DESTINATION examples) -+ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) - endif() - set_target_properties(${name} PROPERTIES FOLDER "Examples") - endmacro(add_llvm_example name) -@@ -1854,7 +1854,7 @@ function(llvm_install_library_symlink name dest type) - set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) - set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) - -- set(output_dir lib${LLVM_LIBDIR_SUFFIX}) -+ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) - if(WIN32 AND "${type}" STREQUAL "SHARED") - set(output_dir bin) - endif() -@@ -1871,7 +1871,7 @@ function(llvm_install_library_symlink name dest type) - endif() - endfunction() - --function(llvm_install_symlink name dest) -+function(llvm_install_symlink name dest output_dir) - cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN}) - foreach(path ${CMAKE_MODULE_PATH}) - if(EXISTS ${path}/LLVMInstallSymlink.cmake) -@@ -1894,7 +1894,7 @@ function(llvm_install_symlink name dest) - set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX}) - - install(SCRIPT ${INSTALL_SYMLINK} -- CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})" -+ CODE "install_symlink(${full_name} ${full_dest} ${output_dir})" - COMPONENT ${component}) - - if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE) -@@ -1977,7 +1977,8 @@ function(add_llvm_tool_symlink link_name target) - endif() - - if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS) -- llvm_install_symlink(${link_name} ${target}) -+ GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR) -+ llvm_install_symlink(${link_name} ${target} ${output_dir}) - endif() - endif() - endfunction() -@@ -2100,9 +2101,9 @@ function(llvm_setup_rpath name) - - if (APPLE) - set(_install_name_dir INSTALL_NAME_DIR "@rpath") -- set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -+ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) - elseif(UNIX) -- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -+ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) - if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") - set_property(TARGET ${name} APPEND_STRING PROPERTY - LINK_FLAGS " -Wl,-z,origin ") -diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake -index 554046b20edf..4d1ad980641e 100644 ---- a/cmake/modules/AddOCaml.cmake -+++ b/cmake/modules/AddOCaml.cmake -@@ -144,9 +144,9 @@ function(add_ocaml_library name) - endforeach() - - if( APPLE ) -- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") -+ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") - elseif( UNIX ) -- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") -+ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") - endif() - list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") - -diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake -index e80c3b5c1cac..482f6d715ef5 100644 ---- a/cmake/modules/AddSphinxTarget.cmake -+++ b/cmake/modules/AddSphinxTarget.cmake -@@ -90,7 +90,7 @@ function (add_sphinx_target builder project) - endif() - elseif (builder STREQUAL html) - string(TOUPPER "${project}" project_upper) -- set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html" -+ set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html" - CACHE STRING "HTML documentation install directory for ${project}") - - # '/.' indicates: copy the contents of the directory directly into -diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt -index 505dc9a29d70..36e6c63af3f4 100644 ---- a/cmake/modules/CMakeLists.txt -+++ b/cmake/modules/CMakeLists.txt -@@ -1,4 +1,4 @@ --set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) -+set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')") - set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") - - # First for users who use an installed LLVM, create the LLVMExports.cmake file. -@@ -107,13 +107,13 @@ foreach(p ${_count}) - set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE} - get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)") - endforeach(p) --set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include") -+set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") - set(LLVM_CONFIG_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}") - set(LLVM_CONFIG_MAIN_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}") --set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}") -+set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") - set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") - set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}") --set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin") -+set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") - - # Generate a default location for lit - if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) -diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake -index 09fed8085c23..aa79f192abf0 100644 ---- a/cmake/modules/LLVMInstallSymlink.cmake -+++ b/cmake/modules/LLVMInstallSymlink.cmake -@@ -10,7 +10,7 @@ function(install_symlink name target outdir) - set(LINK_OR_COPY copy) - endif() - -- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/") -+ set(bindir "${DESTDIR}${outdir}/") - - message(STATUS "Creating ${name}") - -diff --git a/docs/CMake.rst b/docs/CMake.rst -index bb821b417ad9..6a528f7c2ad3 100644 ---- a/docs/CMake.rst -+++ b/docs/CMake.rst -@@ -196,7 +196,7 @@ CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``. - **LLVM_LIBDIR_SUFFIX**:STRING - Extra suffix to append to the directory where libraries are to be - installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` -- to install libraries to ``/usr/lib64``. -+ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. - - **CMAKE_C_FLAGS**:STRING - Extra flags to use when compiling C source files. -@@ -550,8 +550,8 @@ LLVM-specific variables - - **LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING - The path to install Doxygen-generated HTML documentation to. This path can -- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to -- `share/doc/llvm/doxygen-html`. -+ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to -+ `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`. - - **LLVM_ENABLE_SPHINX**:BOOL - If specified, CMake will search for the ``sphinx-build`` executable and will make -@@ -582,13 +582,33 @@ LLVM-specific variables - - **LLVM_INSTALL_SPHINX_HTML_DIR**:STRING - The path to install Sphinx-generated HTML documentation to. This path can -- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to -- `share/doc/llvm/html`. -+ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to -+ `${CMAKE_INSTALL_DOCDIR}/${project}/html`. - - **LLVM_INSTALL_OCAMLDOC_HTML_DIR**:STRING - The path to install OCamldoc-generated HTML documentation to. This path can -- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to -- `share/doc/llvm/ocaml-html`. -+ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to -+ `${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html`. -+ -+**CMAKE_INSTALL_BINDIR**:STRING -+ The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``. -+ Defaults to `bin`. -+ -+**CMAKE_INSTALL_LIBDIR**:STRING -+ The path to install libraries, relative to the ``CMAKE_INSTALL_PREFIX``. -+ Defaults to `lib`. -+ -+**CMAKE_INSTALL_INCLUDEDIR**:STRING -+ The path to install header files, relative to the ``CMAKE_INSTALL_PREFIX``. -+ Defaults to `include`. -+ -+**CMAKE_INSTALL_DOCDIR**:STRING -+ The path to install documentation, relative to the ``CMAKE_INSTALL_PREFIX``. -+ Defaults to `share/doc`. -+ -+**CMAKE_INSTALL_MANDIR**:STRING -+ The path to install manpage files, relative to the ``CMAKE_INSTALL_PREFIX``. -+ Defaults to `share/man`. - - **LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL - macOS Only: If enabled CMake will generate a target named -@@ -786,9 +806,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``). - - This file is available in two different locations. - --* ``/lib/cmake/llvm/LLVMConfig.cmake`` where -- ```` is the install prefix of an installed version of LLVM. -- On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. -+* ``LLVMConfig.cmake`` where -+ ```` is the location where LLVM CMake modules are -+ installed as part of an installed version of LLVM. This is typically -+ ``cmake/llvm/`` within the lib directory. On Linux, this is typically -+ ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. - - * ``/lib/cmake/llvm/LLVMConfig.cmake`` where - ```` is the root of the LLVM build tree. **Note: this is only -diff --git a/examples/Bye/CMakeLists.txt b/examples/Bye/CMakeLists.txt -index bb96edb4b4bf..678c22fb43c8 100644 ---- a/examples/Bye/CMakeLists.txt -+++ b/examples/Bye/CMakeLists.txt -@@ -14,6 +14,6 @@ if (NOT WIN32) - BUILDTREE_ONLY - ) - -- install(TARGETS ${name} RUNTIME DESTINATION examples) -+ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) - set_target_properties(${name} PROPERTIES FOLDER "Examples") - endif() -diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt -index b46319f24fc8..2feabd1954e4 100644 ---- a/include/llvm/CMakeLists.txt -+++ b/include/llvm/CMakeLists.txt -@@ -5,5 +5,5 @@ add_subdirectory(Frontend) - # If we're doing an out-of-tree build, copy a module map for generated - # header files into the build area. - if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") -- configure_file(module.modulemap.build module.modulemap COPYONLY) -+ configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY) - endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") -diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in -index ebe5b73a5c65..70c497be12f5 100644 ---- a/tools/llvm-config/BuildVariables.inc.in -+++ b/tools/llvm-config/BuildVariables.inc.in -@@ -23,6 +23,10 @@ - #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" - #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" - #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" -+#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@" -+#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" -+#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" -+#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@" - #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" - #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" - #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" -diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp -index 1a2f04552d13..44fa7d3eec6b 100644 ---- a/tools/llvm-config/llvm-config.cpp -+++ b/tools/llvm-config/llvm-config.cpp -@@ -357,12 +357,26 @@ int main(int argc, char **argv) { - ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); - } else { - ActivePrefix = CurrentExecPrefix; -- ActiveIncludeDir = ActivePrefix + "/include"; -- SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); -- sys::fs::make_absolute(ActivePrefix, path); -- ActiveBinDir = std::string(path.str()); -- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; -- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; -+ { -+ SmallString<256> path(StringRef(LLVM_INSTALL_INCLUDEDIR)); -+ sys::fs::make_absolute(ActivePrefix, path); -+ ActiveIncludeDir = std::string(path.str()); -+ } -+ { -+ SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR)); -+ sys::fs::make_absolute(ActivePrefix, path); -+ ActiveBinDir = std::string(path.str()); -+ } -+ { -+ SmallString<256> path(StringRef(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX)); -+ sys::fs::make_absolute(ActivePrefix, path); -+ ActiveLibDir = std::string(path.str()); -+ } -+ { -+ SmallString<256> path(StringRef(LLVM_INSTALL_CMAKEDIR)); -+ sys::fs::make_absolute(ActivePrefix, path); -+ ActiveCMakeDir = std::string(path.str()); -+ } - ActiveIncludeOption = "-I" + ActiveIncludeDir; - } - -diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt -index 2963f97cad88..69d66c9c9ca1 100644 ---- a/tools/lto/CMakeLists.txt -+++ b/tools/lto/CMakeLists.txt -@@ -25,7 +25,7 @@ add_llvm_library(LTO SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS - intrinsics_gen) - - install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h -- DESTINATION include/llvm-c -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c - COMPONENT LTO) - - if (APPLE) -diff --git a/tools/opt-viewer/CMakeLists.txt b/tools/opt-viewer/CMakeLists.txt -index ead73ec13a8f..250362021f17 100644 ---- a/tools/opt-viewer/CMakeLists.txt -+++ b/tools/opt-viewer/CMakeLists.txt -@@ -8,7 +8,7 @@ set (files - - foreach (file ${files}) - install(PROGRAMS ${file} -- DESTINATION share/opt-viewer -+ DESTINATION ${CMAKE_INSTALL_DATADIR}/opt-viewer - COMPONENT opt-viewer) - endforeach (file) - -diff --git a/tools/remarks-shlib/CMakeLists.txt b/tools/remarks-shlib/CMakeLists.txt -index 865436247270..ce1daa62f6ab 100644 ---- a/tools/remarks-shlib/CMakeLists.txt -+++ b/tools/remarks-shlib/CMakeLists.txt -@@ -19,7 +19,7 @@ if(LLVM_ENABLE_PIC) - endif() - - install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h -- DESTINATION include/llvm-c -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c - COMPONENT Remarks) - - if (APPLE) diff --git a/pkgs/development/compilers/llvm/12/llvm/no-pipes.patch b/pkgs/development/compilers/llvm/12/llvm/no-pipes.patch deleted file mode 100644 index 5b3d94e21ff6..000000000000 --- a/pkgs/development/compilers/llvm/12/llvm/no-pipes.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/test/Bindings/Go/lit.local.cfg b/test/Bindings/Go/lit.local.cfg -index 91a0ad89..4da83a1a 100644 ---- a/test/Bindings/Go/lit.local.cfg -+++ b/test/Bindings/Go/lit.local.cfg -@@ -1,5 +1,4 @@ - import os --import pipes - import shlex - import sys - -@@ -56,7 +55,7 @@ def fixup_compiler_path(compiler): - except (AttributeError, OSError): - pass - -- return ' '.join([pipes.quote(arg) for arg in args]) -+ return ' '.join([shlex.quote(arg) for arg in args]) - - config.environment['CC'] = fixup_compiler_path(config.host_cc) - config.environment['CXX'] = fixup_compiler_path(config.host_cxx) diff --git a/pkgs/development/compilers/llvm/13/clang/revert-malloc-alignment-assumption.patch b/pkgs/development/compilers/llvm/13/clang/revert-malloc-alignment-assumption.patch deleted file mode 100644 index f8e55ff7f897..000000000000 --- a/pkgs/development/compilers/llvm/13/clang/revert-malloc-alignment-assumption.patch +++ /dev/null @@ -1,78 +0,0 @@ ---- b/include/clang/Basic/TargetInfo.h -+++ a/include/clang/Basic/TargetInfo.h -@@ -612,8 +612,8 @@ - } - - /// Return the largest alignment for which a suitably-sized allocation with -+ /// '::operator new(size_t)' is guaranteed to produce a correctly-aligned -+ /// pointer. -- /// '::operator new(size_t)' or 'malloc' is guaranteed to produce a -- /// correctly-aligned pointer. - unsigned getNewAlign() const { - return NewAlign ? NewAlign : std::max(LongDoubleAlign, LongLongAlign); - } ---- b/lib/CodeGen/CGCall.cpp -+++ a/lib/CodeGen/CGCall.cpp -@@ -2048,24 +2048,6 @@ - // allows it to work on indirect virtual function calls. - if (AttrOnCallSite && TargetDecl->hasAttr()) - FuncAttrs.addAttribute(llvm::Attribute::NoMerge); -- -- // Add known guaranteed alignment for allocation functions. -- if (unsigned BuiltinID = Fn->getBuiltinID()) { -- switch (BuiltinID) { -- case Builtin::BIaligned_alloc: -- case Builtin::BIcalloc: -- case Builtin::BImalloc: -- case Builtin::BImemalign: -- case Builtin::BIrealloc: -- case Builtin::BIstrdup: -- case Builtin::BIstrndup: -- RetAttrs.addAlignmentAttr(Context.getTargetInfo().getNewAlign() / -- Context.getTargetInfo().getCharWidth()); -- break; -- default: -- break; -- } -- } - } - - // 'const', 'pure' and 'noalias' attributed functions are also nounwind. ---- b/test/CodeGen/alloc-fns-alignment.c -+++ /dev/null -@@ -1,35 +0,0 @@ --// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm < %s | FileCheck %s --check-prefix=ALIGN16 --// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm < %s | FileCheck %s --check-prefix=ALIGN16 --// RUN: %clang_cc1 -triple i386-apple-darwin -emit-llvm < %s | FileCheck %s --check-prefix=ALIGN16 --// RUN: %clang_cc1 -triple i386-unknown-linux-gnu -emit-llvm < %s | FileCheck %s --check-prefix=ALIGN8 --// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fno-builtin-malloc -emit-llvm < %s | FileCheck %s --check-prefix=NOBUILTIN-MALLOC --// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fno-builtin-calloc -emit-llvm < %s | FileCheck %s --check-prefix=NOBUILTIN-CALLOC --// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fno-builtin-realloc -emit-llvm < %s | FileCheck %s --check-prefix=NOBUILTIN-REALLOC -- --typedef __SIZE_TYPE__ size_t; -- --void *malloc(size_t); --void *calloc(size_t, size_t); --void *realloc(void *, size_t); -- --void *malloc_test(size_t n) { -- return malloc(n); --} -- --void *calloc_test(size_t n) { -- return calloc(1, n); --} -- --void *raalloc_test(void *p, size_t n) { -- return realloc(p, n); --} -- --// ALIGN16: align 16 i8* @malloc --// ALIGN16: align 16 i8* @calloc --// ALIGN16: align 16 i8* @realloc --// ALIGN8: align 8 i8* @malloc --// ALIGN8: align 8 i8* @calloc --// ALIGN8: align 8 i8* @realloc --// NOBUILTIN-MALLOC: declare i8* @malloc --// NOBUILTIN-CALLOC: declare i8* @calloc --// NOBUILTIN-REALLOC: declare i8* @realloc diff --git a/pkgs/development/compilers/llvm/13/compiler-rt/armv7l.patch b/pkgs/development/compilers/llvm/13/compiler-rt/armv7l.patch deleted file mode 100644 index 6818684e6a71..000000000000 --- a/pkgs/development/compilers/llvm/13/compiler-rt/armv7l.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff -ur compiler-rt-10.0.0.src/cmake/builtin-config-ix.cmake compiler-rt-10.0.0.src-patched/cmake/builtin-config-ix.cmake ---- compiler-rt-10.0.0.src/cmake/builtin-config-ix.cmake 2020-03-24 00:01:02.000000000 +0900 -+++ compiler-rt-10.0.0.src-patched/cmake/builtin-config-ix.cmake 2020-05-10 03:42:00.883450706 +0900 -@@ -37,6 +37,6 @@ - - set(ARM64 aarch64) --set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv8m.main armv8.1m.main) -+set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l armv8m.main armv8.1m.main) - set(HEXAGON hexagon) - set(X86 i386) - set(X86_64 x86_64) -diff -ur compiler-rt-10.0.0.src/lib/builtins/CMakeLists.txt compiler-rt-10.0.0.src-patched/lib/builtins/CMakeLists.txt ---- compiler-rt-10.0.0.src/lib/builtins/CMakeLists.txt 2020-03-24 00:01:02.000000000 +0900 -+++ compiler-rt-10.0.0.src-patched/lib/builtins/CMakeLists.txt 2020-05-10 03:44:49.468579650 +0900 -@@ -555,6 +555,7 @@ - set(armv7_SOURCES ${arm_SOURCES}) - set(armv7s_SOURCES ${arm_SOURCES}) - set(armv7k_SOURCES ${arm_SOURCES}) -+set(armv7l_SOURCES ${arm_SOURCES}) - set(arm64_SOURCES ${aarch64_SOURCES}) - - # macho_embedded archs -@@ -705,7 +705,7 @@ - foreach (arch ${BUILTIN_SUPPORTED_ARCH}) - if (CAN_TARGET_${arch}) - # For ARM archs, exclude any VFP builtins if VFP is not supported -- if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em|armv8m.main|armv8.1m.main)$") -+ if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em|armv8m.main|armv8.1m.main)$") - string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}") - check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP) - if(NOT COMPILER_RT_HAS_${arch}_VFP) diff --git a/pkgs/development/compilers/llvm/13/compiler-rt/codesign.patch b/pkgs/development/compilers/llvm/13/compiler-rt/codesign.patch deleted file mode 100644 index 065959d14d46..000000000000 --- a/pkgs/development/compilers/llvm/13/compiler-rt/codesign.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 3dec5f3475a26aeb4678627795c4b67c6b7b4785 Mon Sep 17 00:00:00 2001 -From: Will Dietz -Date: Tue, 19 Sep 2017 13:13:06 -0500 -Subject: [PATCH] remove codesign use on Apple, disable ios sim testing that - needs it - ---- - cmake/Modules/AddCompilerRT.cmake | 8 ------ - test/asan/CMakeLists.txt | 52 --------------------------------------- - test/tsan/CMakeLists.txt | 47 ----------------------------------- - 3 files changed, 107 deletions(-) - -diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake -index bc69ec95c419..9f100fdcec2f 100644 ---- a/cmake/Modules/AddCompilerRT.cmake -+++ b/cmake/Modules/AddCompilerRT.cmake -@@ -366,14 +366,6 @@ function(add_compiler_rt_runtime name type) - set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "") - set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib") - endif() -- if(APPLE) -- # Ad-hoc sign the dylibs -- add_custom_command(TARGET ${libname} -- POST_BUILD -- COMMAND codesign --sign - $ -- WORKING_DIRECTORY ${COMPILER_RT_OUTPUT_LIBRARY_DIR} -- ) -- endif() - endif() - - set(parent_target_arg) -2.14.1 - diff --git a/pkgs/development/compilers/llvm/13/compiler-rt/darwin-targetconditionals.patch b/pkgs/development/compilers/llvm/13/compiler-rt/darwin-targetconditionals.patch deleted file mode 100644 index 425dc2af01e7..000000000000 --- a/pkgs/development/compilers/llvm/13/compiler-rt/darwin-targetconditionals.patch +++ /dev/null @@ -1,71 +0,0 @@ -diff --git a/lib/sanitizer_common/sanitizer_mac.cpp b/lib/sanitizer_common/sanitizer_mac.cpp ---- a/lib/sanitizer_common/sanitizer_mac.cpp -+++ b/lib/sanitizer_common/sanitizer_mac.cpp -@@ -613,9 +613,15 @@ HandleSignalMode GetHandleSignalMode(int signum) { - // Offset example: - // XNU 17 -- macOS 10.13 -- iOS 11 -- tvOS 11 -- watchOS 4 - constexpr u16 GetOSMajorKernelOffset() { -- if (TARGET_OS_OSX) return 4; -- if (TARGET_OS_IOS || TARGET_OS_TV) return 6; -- if (TARGET_OS_WATCH) return 13; -+#if TARGET_OS_OSX -+ return 4; -+#endif -+#if TARGET_OS_IOS || TARGET_OS_TV -+ return 6; -+#endif -+#if TARGET_OS_WATCH -+ return 13; -+#endif - } - - using VersStr = char[64]; -@@ -627,13 +633,13 @@ static uptr ApproximateOSVersionViaKernelVersion(VersStr vers) { - u16 os_major = kernel_major - offset; - - const char *format = "%d.0"; -- if (TARGET_OS_OSX) { -- if (os_major >= 16) { // macOS 11+ -- os_major -= 5; -- } else { // macOS 10.15 and below -- format = "10.%d"; -- } -+#if TARGET_OS_OSX -+ if (os_major >= 16) { // macOS 11+ -+ os_major -= 5; -+ } else { // macOS 10.15 and below -+ format = "10.%d"; - } -+#endif - return internal_snprintf(vers, sizeof(VersStr), format, os_major); - } - -@@ -681,15 +687,14 @@ void ParseVersion(const char *vers, u16 *major, u16 *minor) { - // Aligned versions example: - // macOS 10.15 -- iOS 13 -- tvOS 13 -- watchOS 6 - static void MapToMacos(u16 *major, u16 *minor) { -- if (TARGET_OS_OSX) -- return; -- -- if (TARGET_OS_IOS || TARGET_OS_TV) -+#if !TARGET_OS_OSX -+#if TARGET_OS_IOS || TARGET_OS_TV - *major += 2; -- else if (TARGET_OS_WATCH) -+#elif TARGET_OS_WATCH - *major += 9; -- else -+#else - UNREACHABLE("unsupported platform"); -+#endif - - if (*major >= 16) { // macOS 11+ - *major -= 5; -@@ -697,6 +702,7 @@ static void MapToMacos(u16 *major, u16 *minor) { - *minor = *major; - *major = 10; - } -+#endif - } - - static MacosVersion GetMacosAlignedVersionInternal() { diff --git a/pkgs/development/compilers/llvm/13/libunwind/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/13/libunwind/gnu-install-dirs.patch deleted file mode 100644 index 8cd25c56f8cc..000000000000 --- a/pkgs/development/compilers/llvm/13/libunwind/gnu-install-dirs.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 81eddbc24879..e2afb2002150 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -23,6 +23,8 @@ set(LIBUNWIND_LIBCXX_PATH "${CMAKE_CURRENT_LIST_DIR}/../libcxx" CACHE PATH - if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBUNWIND_STANDALONE_BUILD) - project(libunwind LANGUAGES C CXX ASM) - -+ include(GNUInstallDirs) -+ - set(PACKAGE_NAME libunwind) - set(PACKAGE_VERSION 13.0.0git) - set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") -@@ -116,7 +118,7 @@ set(CMAKE_MODULE_PATH - - if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) - set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}) -- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH -+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH - "Path where built libunwind libraries should be installed.") - if(LIBCXX_LIBDIR_SUBDIR) - string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) -@@ -124,11 +126,11 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) - endif() - elseif(LLVM_LIBRARY_OUTPUT_INTDIR) - set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) -- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX} CACHE PATH -+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} CACHE PATH - "Path where built libunwind libraries should be installed.") - else() - set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX}) -- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX} CACHE PATH -+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} CACHE PATH - "Path where built libunwind libraries should be installed.") - endif() - diff --git a/pkgs/development/compilers/llvm/13/lldb/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/13/lldb/gnu-install-dirs.patch deleted file mode 100644 index eba6fbabac62..000000000000 --- a/pkgs/development/compilers/llvm/13/lldb/gnu-install-dirs.patch +++ /dev/null @@ -1,110 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b5633e21c56a..f2f1035e9238 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -10,6 +10,8 @@ set(CMAKE_MODULE_PATH - # If we are not building as part of LLVM, build LLDB as a standalone project, - # using LLVM as an external library. - if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) -+ include(GNUInstallDirs) -+ - project(lldb) - include(LLDBStandalone) - -diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake -index 4ed5c647c5d2..89f96e710d55 100644 ---- a/cmake/modules/AddLLDB.cmake -+++ b/cmake/modules/AddLLDB.cmake -@@ -107,13 +107,13 @@ function(add_lldb_library name) - endif() - - if(PARAM_SHARED) -- set(install_dest lib${LLVM_LIBDIR_SUFFIX}) -+ set(install_dest ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) - if(PARAM_INSTALL_PREFIX) - set(install_dest ${PARAM_INSTALL_PREFIX}) - endif() - # RUNTIME is relevant for DLL platforms, FRAMEWORK for macOS - install(TARGETS ${name} COMPONENT ${name} -- RUNTIME DESTINATION bin -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${install_dest} - ARCHIVE DESTINATION ${install_dest} - FRAMEWORK DESTINATION ${install_dest}) -diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake -index 2fdf1502d055..37364341ff8b 100644 ---- a/cmake/modules/LLDBConfig.cmake -+++ b/cmake/modules/LLDBConfig.cmake -@@ -225,7 +225,7 @@ include_directories(BEFORE - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - install(DIRECTORY include/ - COMPONENT lldb-headers -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING - PATTERN "*.h" - PATTERN ".cmake" EXCLUDE -@@ -233,7 +233,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ - COMPONENT lldb-headers -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING - PATTERN "*.h" - PATTERN ".cmake" EXCLUDE -diff --git a/tools/intel-features/CMakeLists.txt b/tools/intel-features/CMakeLists.txt -index 734167e51bc5..f95761b5df58 100644 ---- a/tools/intel-features/CMakeLists.txt -+++ b/tools/intel-features/CMakeLists.txt -@@ -65,4 +65,4 @@ if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT) - endif() - - install(TARGETS lldbIntelFeatures -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}) -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) -diff --git a/cmake/modules/LLDBStandalone.cmake b/cmake/modules/LLDBStandalone.cmake -index 752113b..010f187 100644 ---- a/cmake/modules/LLDBStandalone.cmake -+++ b/cmake/modules/LLDBStandalone.cmake -@@ -62,7 +62,7 @@ endif() - - # They are used as destination of target generators. - set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) --set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) -+set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) - if(WIN32 OR CYGWIN) - # DLL platform -- put DLLs into bin. - set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b5633e2..86e4738 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -79,7 +79,7 @@ if (LLDB_ENABLE_PYTHON) - if(LLDB_BUILD_FRAMEWORK) - set(lldb_python_target_dir "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Python/lldb") - else() -- set(lldb_python_target_dir "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb") -+ set(lldb_python_target_dir "${CMAKE_INSTALL_LIBDIR}/../${LLDB_PYTHON_RELATIVE_PATH}/lldb") - endif() - get_target_property(lldb_python_bindings_dir swig_wrapper_python BINARY_DIR) - finish_swig_python("lldb-python" "${lldb_python_bindings_dir}" "${lldb_python_target_dir}") -diff --git a/source/API/CMakeLists.txt b/source/API/CMakeLists.txt -index b5633e2..86e4738 100644 ---- a/source/API/CMakeLists.txt 2024-05-30 21:38:39.829955586 -0700 -+++ b/source/API/CMakeLists.txt 2024-05-30 21:38:48.015673758 -0700 -@@ -112,14 +112,6 @@ - ${option_install_prefix} - ) - --# lib/pythonX.Y/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so, --# which depends on lib/libLLVM*.so (BUILD_SHARED_LIBS) or lib/libLLVM-10git.so --# (LLVM_LINK_LLVM_DYLIB). Add an additional rpath $ORIGIN/../../../../lib so --# that _lldb.so can be loaded from Python. --if(LLDB_ENABLE_PYTHON AND (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB) AND UNIX AND NOT APPLE) -- set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "\$ORIGIN/../../../../lib${LLVM_LIBDIR_SUFFIX}") --endif() -- - if(Python3_RPATH) - set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "${Python3_RPATH}") - set_property(TARGET liblldb APPEND PROPERTY BUILD_RPATH "${Python3_RPATH}") diff --git a/pkgs/development/compilers/llvm/13/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/13/llvm/gnu-install-dirs.patch deleted file mode 100644 index 18fa5fc6d89c..000000000000 --- a/pkgs/development/compilers/llvm/13/llvm/gnu-install-dirs.patch +++ /dev/null @@ -1,381 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 135036f509d2..265c36f8211b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -270,15 +270,21 @@ if (CMAKE_BUILD_TYPE AND - message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") - endif() - -+include(GNUInstallDirs) -+ - set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) - --set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')") -+set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING -+ "Path for binary subdirectory (defaults to 'bin')") - mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) - - set(LLVM_UTILS_INSTALL_DIR "${LLVM_TOOLS_INSTALL_DIR}" CACHE STRING - "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)") - mark_as_advanced(LLVM_UTILS_INSTALL_DIR) - -+set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING -+ "Path for CMake subdirectory (defaults to lib/cmake/llvm)" ) -+ - # They are used as destination of target generators. - set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) - set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) -@@ -581,9 +587,9 @@ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF) - option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON) - option (LLVM_ENABLE_BINDINGS "Build bindings." ON) - --set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html" -+set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html" - CACHE STRING "Doxygen-generated HTML documentation install directory") --set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html" -+set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html" - CACHE STRING "OCamldoc-generated HTML documentation install directory") - - option (LLVM_BUILD_EXTERNAL_COMPILER_RT -@@ -1048,7 +1054,7 @@ endif() - - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - install(DIRECTORY include/llvm include/llvm-c -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT llvm-headers - FILES_MATCHING - PATTERN "*.def" -@@ -1059,7 +1065,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - ) - - install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm ${LLVM_INCLUDE_DIR}/llvm-c -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT llvm-headers - FILES_MATCHING - PATTERN "*.def" -@@ -1073,13 +1079,13 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - - if (LLVM_INSTALL_MODULEMAPS) - install(DIRECTORY include/llvm include/llvm-c -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT llvm-headers - FILES_MATCHING - PATTERN "module.modulemap" - ) - install(FILES include/llvm/module.install.modulemap -- DESTINATION include/llvm -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm - COMPONENT llvm-headers - RENAME "module.extern.modulemap" - ) -diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake -index 9c2b85374307..5531ceeb2eeb 100644 ---- a/cmake/modules/AddLLVM.cmake -+++ b/cmake/modules/AddLLVM.cmake -@@ -818,9 +818,9 @@ macro(add_llvm_library name) - get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella}) - install(TARGETS ${name} - ${export_to_llvmexports} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -- RUNTIME DESTINATION bin COMPONENT ${name}) -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${name}) - - if (NOT LLVM_ENABLE_IDE) - add_llvm_install_targets(install-${name} -@@ -1036,7 +1036,7 @@ function(process_llvm_pass_plugins) - "set(LLVM_STATIC_EXTENSIONS ${LLVM_STATIC_EXTENSIONS})") - install(FILES - ${llvm_cmake_builddir}/LLVMConfigExtensions.cmake -- DESTINATION ${LLVM_INSTALL_PACKAGE_DIR} -+ DESTINATION ${LLVM_INSTALL_CMAKE_DIR} - COMPONENT cmake-exports) - - set(ExtensionDef "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def") -@@ -1250,7 +1250,7 @@ macro(add_llvm_example name) - endif() - add_llvm_executable(${name} ${ARGN}) - if( LLVM_BUILD_EXAMPLES ) -- install(TARGETS ${name} RUNTIME DESTINATION examples) -+ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) - endif() - set_target_properties(${name} PROPERTIES FOLDER "Examples") - endmacro(add_llvm_example name) -@@ -1868,7 +1868,7 @@ function(llvm_install_library_symlink name dest type) - set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) - set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) - -- set(output_dir lib${LLVM_LIBDIR_SUFFIX}) -+ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) - if(WIN32 AND "${type}" STREQUAL "SHARED") - set(output_dir bin) - endif() -@@ -1879,7 +1879,7 @@ function(llvm_install_library_symlink name dest type) - - endfunction() - --function(llvm_install_symlink name dest) -+function(llvm_install_symlink name dest output_dir) - cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN}) - foreach(path ${CMAKE_MODULE_PATH}) - if(EXISTS ${path}/LLVMInstallSymlink.cmake) -@@ -1902,7 +1902,7 @@ function(llvm_install_symlink name dest) - set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX}) - - install(SCRIPT ${INSTALL_SYMLINK} -- CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})" -+ CODE "install_symlink(${full_name} ${full_dest} ${output_dir})" - COMPONENT ${component}) - - if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE) -@@ -1985,7 +1985,8 @@ function(add_llvm_tool_symlink link_name target) - endif() - - if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS) -- llvm_install_symlink(${link_name} ${target}) -+ GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR) -+ llvm_install_symlink(${link_name} ${target} ${output_dir}) - endif() - endif() - endfunction() -@@ -2114,9 +2115,9 @@ function(llvm_setup_rpath name) - # Since BUILD_SHARED_LIBS is only recommended for use by developers, - # hardcode the rpath to build/install lib dir first in this mode. - # FIXME: update this when there is better solution. -- set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -+ set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) - elseif(UNIX) -- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -+ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) - if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") - set_property(TARGET ${name} APPEND_STRING PROPERTY - LINK_FLAGS " -Wl,-z,origin ") -diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake -index 554046b20edf..4d1ad980641e 100644 ---- a/cmake/modules/AddOCaml.cmake -+++ b/cmake/modules/AddOCaml.cmake -@@ -144,9 +144,9 @@ function(add_ocaml_library name) - endforeach() - - if( APPLE ) -- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") -+ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") - elseif( UNIX ) -- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") -+ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") - endif() - list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") - -diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake -index e80c3b5c1cac..482f6d715ef5 100644 ---- a/cmake/modules/AddSphinxTarget.cmake -+++ b/cmake/modules/AddSphinxTarget.cmake -@@ -90,7 +90,7 @@ function (add_sphinx_target builder project) - endif() - elseif (builder STREQUAL html) - string(TOUPPER "${project}" project_upper) -- set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html" -+ set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html" - CACHE STRING "HTML documentation install directory for ${project}") - - # '/.' indicates: copy the contents of the directory directly into -diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt -index 51b6a4fdc284..4adc2acfc074 100644 ---- a/cmake/modules/CMakeLists.txt -+++ b/cmake/modules/CMakeLists.txt -@@ -1,6 +1,6 @@ - include(LLVMDistributionSupport) - --set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) -+set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')") - set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") - - # First for users who use an installed LLVM, create the LLVMExports.cmake file. -@@ -109,13 +109,13 @@ foreach(p ${_count}) - set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE} - get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)") - endforeach(p) --set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include") -+set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") - set(LLVM_CONFIG_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}") - set(LLVM_CONFIG_MAIN_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}") --set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}") -+set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") - set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") - set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}") --set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin") -+set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") - - # Generate a default location for lit - if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) -diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake -index 3e6a2c9a2648..52e14d955c60 100644 ---- a/cmake/modules/LLVMInstallSymlink.cmake -+++ b/cmake/modules/LLVMInstallSymlink.cmake -@@ -4,7 +4,7 @@ - - function(install_symlink name target outdir) - set(DESTDIR $ENV{DESTDIR}) -- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/") -+ set(bindir "${DESTDIR}${outdir}/") - - message(STATUS "Creating ${name}") - -diff --git a/docs/CMake.rst b/docs/CMake.rst -index f1ac2c7d4934..c6e1469b5e13 100644 ---- a/docs/CMake.rst -+++ b/docs/CMake.rst -@@ -202,7 +202,7 @@ CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``. - **LLVM_LIBDIR_SUFFIX**:STRING - Extra suffix to append to the directory where libraries are to be - installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` -- to install libraries to ``/usr/lib64``. -+ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. - - Rarely-used CMake variables - --------------------------- -@@ -551,8 +551,8 @@ LLVM-specific variables - - **LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING - The path to install Doxygen-generated HTML documentation to. This path can -- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to -- `share/doc/llvm/doxygen-html`. -+ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to -+ `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`. - - **LLVM_LINK_LLVM_DYLIB**:BOOL - If enabled, tools will be linked with the libLLVM shared library. Defaults -@@ -792,9 +792,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``). - - This file is available in two different locations. - --* ``/lib/cmake/llvm/LLVMConfig.cmake`` where -- ```` is the install prefix of an installed version of LLVM. -- On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. -+* ``LLVMConfig.cmake`` where -+ ```` is the location where LLVM CMake modules are -+ installed as part of an installed version of LLVM. This is typically -+ ``cmake/llvm/`` within the lib directory. On Linux, this is typically -+ ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. - - * ``/lib/cmake/llvm/LLVMConfig.cmake`` where - ```` is the root of the LLVM build tree. **Note: this is only -diff --git a/examples/Bye/CMakeLists.txt b/examples/Bye/CMakeLists.txt -index bb96edb4b4bf..678c22fb43c8 100644 ---- a/examples/Bye/CMakeLists.txt -+++ b/examples/Bye/CMakeLists.txt -@@ -14,6 +14,6 @@ if (NOT WIN32) - BUILDTREE_ONLY - ) - -- install(TARGETS ${name} RUNTIME DESTINATION examples) -+ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) - set_target_properties(${name} PROPERTIES FOLDER "Examples") - endif() -diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt -index b46319f24fc8..2feabd1954e4 100644 ---- a/include/llvm/CMakeLists.txt -+++ b/include/llvm/CMakeLists.txt -@@ -5,5 +5,5 @@ add_subdirectory(Frontend) - # If we're doing an out-of-tree build, copy a module map for generated - # header files into the build area. - if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") -- configure_file(module.modulemap.build module.modulemap COPYONLY) -+ configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY) - endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") -diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in -index ebe5b73a5c65..70c497be12f5 100644 ---- a/tools/llvm-config/BuildVariables.inc.in -+++ b/tools/llvm-config/BuildVariables.inc.in -@@ -23,6 +23,10 @@ - #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" - #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" - #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" -+#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@" -+#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" -+#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" -+#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@" - #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" - #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" - #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" -diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp -index 1a2f04552d13..44fa7d3eec6b 100644 ---- a/tools/llvm-config/llvm-config.cpp -+++ b/tools/llvm-config/llvm-config.cpp -@@ -357,12 +357,26 @@ int main(int argc, char **argv) { - ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); - } else { - ActivePrefix = CurrentExecPrefix; -- ActiveIncludeDir = ActivePrefix + "/include"; -- SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); -- sys::fs::make_absolute(ActivePrefix, path); -- ActiveBinDir = std::string(path.str()); -- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; -- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; -+ { -+ SmallString<256> path(StringRef(LLVM_INSTALL_INCLUDEDIR)); -+ sys::fs::make_absolute(ActivePrefix, path); -+ ActiveIncludeDir = std::string(path.str()); -+ } -+ { -+ SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR)); -+ sys::fs::make_absolute(ActivePrefix, path); -+ ActiveBinDir = std::string(path.str()); -+ } -+ { -+ SmallString<256> path(StringRef(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX)); -+ sys::fs::make_absolute(ActivePrefix, path); -+ ActiveLibDir = std::string(path.str()); -+ } -+ { -+ SmallString<256> path(StringRef(LLVM_INSTALL_CMAKEDIR)); -+ sys::fs::make_absolute(ActivePrefix, path); -+ ActiveCMakeDir = std::string(path.str()); -+ } - ActiveIncludeOption = "-I" + ActiveIncludeDir; - } - -diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt -index 0af29ad762c5..37b99b83e35c 100644 ---- a/tools/lto/CMakeLists.txt -+++ b/tools/lto/CMakeLists.txt -@@ -33,7 +33,7 @@ add_llvm_library(${LTO_LIBRARY_NAME} ${LTO_LIBRARY_TYPE} INSTALL_WITH_TOOLCHAIN - ${SOURCES} DEPENDS intrinsics_gen) - - install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h -- DESTINATION include/llvm-c -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c - COMPONENT LTO) - - if (APPLE) -diff --git a/tools/opt-viewer/CMakeLists.txt b/tools/opt-viewer/CMakeLists.txt -index ead73ec13a8f..250362021f17 100644 ---- a/tools/opt-viewer/CMakeLists.txt -+++ b/tools/opt-viewer/CMakeLists.txt -@@ -8,7 +8,7 @@ set (files - - foreach (file ${files}) - install(PROGRAMS ${file} -- DESTINATION share/opt-viewer -+ DESTINATION ${CMAKE_INSTALL_DATADIR}/opt-viewer - COMPONENT opt-viewer) - endforeach (file) - -diff --git a/tools/remarks-shlib/CMakeLists.txt b/tools/remarks-shlib/CMakeLists.txt -index 865436247270..ce1daa62f6ab 100644 ---- a/tools/remarks-shlib/CMakeLists.txt -+++ b/tools/remarks-shlib/CMakeLists.txt -@@ -19,7 +19,7 @@ if(LLVM_ENABLE_PIC) - endif() - - install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h -- DESTINATION include/llvm-c -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c - COMPONENT Remarks) - - if (APPLE) diff --git a/pkgs/development/compilers/llvm/14/clang/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/14/clang/gnu-install-dirs.patch deleted file mode 100644 index 57c54e18c37b..000000000000 --- a/pkgs/development/compilers/llvm/14/clang/gnu-install-dirs.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake -index 9bbbfc032b7d..947bd0da865d 100644 ---- a/cmake/modules/AddClang.cmake -+++ b/cmake/modules/AddClang.cmake -@@ -119,8 +119,8 @@ macro(add_clang_library name) - install(TARGETS ${lib} - COMPONENT ${lib} - ${export_to_clangtargets} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - - if (NOT LLVM_ENABLE_IDE) -@@ -175,7 +175,7 @@ endmacro() - macro(add_clang_symlink name dest) - add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) - # Always generate install targets -- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) -+ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) - endmacro() - - function(clang_target_link_libraries target type) -diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt -index 078988980c52..14b58614b40a 100644 ---- a/lib/Headers/CMakeLists.txt -+++ b/lib/Headers/CMakeLists.txt -@@ -234,7 +234,7 @@ set_target_properties(clang-resource-headers PROPERTIES - FOLDER "Misc" - RUNTIME_OUTPUT_DIRECTORY "${output_dir}") - --set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) -+set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) - - install( - FILES ${files} ${generated_files} -diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt -index 4e0647971ab4..68dd67fcc476 100644 ---- a/tools/libclang/CMakeLists.txt -+++ b/tools/libclang/CMakeLists.txt -@@ -216,7 +216,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS}) - COMPONENT - libclang-python-bindings - DESTINATION -- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") -+ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") - endforeach() - if(NOT LLVM_ENABLE_IDE) - add_custom_target(libclang-python-bindings) diff --git a/pkgs/development/compilers/llvm/14/compiler-rt/armv6-scudo-libatomic.patch b/pkgs/development/compilers/llvm/14/compiler-rt/armv6-scudo-libatomic.patch deleted file mode 100644 index 13b67eb2a41c..000000000000 --- a/pkgs/development/compilers/llvm/14/compiler-rt/armv6-scudo-libatomic.patch +++ /dev/null @@ -1,65 +0,0 @@ -From a56bb19a9dc303a50ef12d83cd24c2395bf81076 Mon Sep 17 00:00:00 2001 -From: Ben Wolsieffer -Date: Wed, 7 Dec 2022 21:25:46 -0500 -Subject: [PATCH] [scudo][standalone] Use CheckAtomic to decide to link to - libatomic - -Standalone scudo uses the atomic operation builtin functions, which require -linking to libatomic on some platforms. Currently, this is done in an ad-hoc -manner. MIPS platforms always link to libatomic, and the tests are always linked -to it as well. libatomic is required on base ARMv6 (but not ARMv6K), but it is -currently not linked, causing the build to fail. - -This patch replaces this ad-hoc logic with the CheckAtomic CMake module already -used in other parts of LLVM. The CheckAtomic module checks whether std::atomic -requires libatomic, which is not strictly the same as checking the atomic -builtins, but should have the same results as far as I know. If this is -problematic, a custom version of CheckAtomic could be used to specifically test -the builtins. ---- - compiler-rt/lib/scudo/standalone/CMakeLists.txt | 7 +++++++ - compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt | 4 +--- - 2 files changed, 8 insertions(+), 3 deletions(-) - -diff --git a/lib/scudo/standalone/CMakeLists.txt b/lib/scudo/standalone/CMakeLists.txt -index ae5c354768c8..eb27374ca520 100644 ---- a/lib/scudo/standalone/CMakeLists.txt -+++ b/lib/scudo/standalone/CMakeLists.txt -@@ -1,5 +1,8 @@ - add_compiler_rt_component(scudo_standalone) - -+include(DetermineGCCCompatible) -+include(CheckAtomic) -+ - include_directories(../.. include) - - set(SCUDO_CFLAGS) -@@ -34,6 +37,10 @@ list(APPEND SCUDO_LINK_FLAGS -Wl,-z,defs,-z,now,-z,relro) - - list(APPEND SCUDO_LINK_FLAGS -ffunction-sections -fdata-sections -Wl,--gc-sections) - -+if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB) -+ list(APPEND SCUDO_LINK_FLAGS -latomic) -+endif() -+ - # We don't use the C++ standard library, so avoid including it by mistake. - append_list_if(COMPILER_RT_HAS_NOSTDLIBXX_FLAG -nostdlib++ SCUDO_LINK_FLAGS) - -diff --git a/lib/scudo/standalone/tests/CMakeLists.txt b/lib/scudo/standalone/tests/CMakeLists.txt -index 6d0936cbb5c1..70a5a7e959c1 100644 ---- a/lib/scudo/standalone/tests/CMakeLists.txt -+++ b/lib/scudo/standalone/tests/CMakeLists.txt -@@ -38,9 +38,7 @@ set(LINK_FLAGS - ${SANITIZER_TEST_CXX_LIBRARIES} - ) - list(APPEND LINK_FLAGS -pthread) --# Linking against libatomic is required with some compilers --check_library_exists(atomic __atomic_load_8 "" COMPILER_RT_HAS_LIBATOMIC) --if (COMPILER_RT_HAS_LIBATOMIC) -+if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB) - list(APPEND LINK_FLAGS -latomic) - endif() - --- -2.38.1 - diff --git a/pkgs/development/compilers/llvm/14/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/14/compiler-rt/gnu-install-dirs.patch deleted file mode 100644 index 55837bd8e45b..000000000000 --- a/pkgs/development/compilers/llvm/14/compiler-rt/gnu-install-dirs.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3a41aa43e406..f000cee6eae0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -5,6 +5,8 @@ - - cmake_minimum_required(VERSION 3.13.4) - -+include(GNUInstallDirs) -+ - # Check if compiler-rt is built as a standalone project. - if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) - project(CompilerRT C CXX ASM) -diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake -index d7b0124f3546..3e111146df4d 100644 ---- a/cmake/base-config-ix.cmake -+++ b/cmake/base-config-ix.cmake -@@ -67,7 +67,7 @@ if (LLVM_TREE_AVAILABLE) - else() - # Take output dir and install path from the user. - set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH -- "Path where built compiler-rt libraries should be stored.") -+ "Path where built compiler-rt build artifacts should be stored.") - set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH - "Path where built compiler-rt executables should be stored.") - set(COMPILER_RT_INSTALL_PATH "" CACHE PATH -@@ -99,13 +99,13 @@ endif() - if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) - set(COMPILER_RT_OUTPUT_LIBRARY_DIR - ${COMPILER_RT_OUTPUT_DIR}/lib) -- extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" lib) -+ extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}") - set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH - "Path where built compiler-rt libraries should be installed.") - else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) - set(COMPILER_RT_OUTPUT_LIBRARY_DIR - ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) -- extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "lib/${COMPILER_RT_OS_DIR}") -+ extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}/${COMPILER_RT_OS_DIR}") - set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH - "Path where built compiler-rt libraries should be installed.") - endif() diff --git a/pkgs/development/compilers/llvm/14/libunwind/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/14/libunwind/gnu-install-dirs.patch deleted file mode 100644 index 3fce8bf90343..000000000000 --- a/pkgs/development/compilers/llvm/14/libunwind/gnu-install-dirs.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -147,7 +147,7 @@ set(LIBUNWIND_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH - - if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) - set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}) -- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH -+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH - "Path where built libunwind libraries should be installed.") - if(LIBCXX_LIBDIR_SUBDIR) - string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) -@@ -159,7 +159,7 @@ else() - else() - set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX}) - endif() -- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX} CACHE PATH -+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX} CACHE PATH - "Path where built libunwind libraries should be installed.") - endif() - diff --git a/pkgs/development/compilers/llvm/14/lld/fix-root-src-dir.patch b/pkgs/development/compilers/llvm/14/lld/fix-root-src-dir.patch deleted file mode 100644 index 38fb965b472a..000000000000 --- a/pkgs/development/compilers/llvm/14/lld/fix-root-src-dir.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9bcc135665d0..d38679ed41e9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -74,7 +74,7 @@ if(LLD_BUILT_STANDALONE) - - set(LLVM_MAIN_INCLUDE_DIR "${MAIN_INCLUDE_DIR}" CACHE PATH "Path to llvm/include") - set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree") -- set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree") -+ set(LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm" CACHE PATH "Path to LLVM source tree") - - find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR} - NO_DEFAULT_PATH) diff --git a/pkgs/development/compilers/llvm/14/lld/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/14/lld/gnu-install-dirs.patch deleted file mode 100644 index 89a5822df49c..000000000000 --- a/pkgs/development/compilers/llvm/14/lld/gnu-install-dirs.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake -index dd2898ce6236..ebbea040ff54 100644 ---- a/cmake/modules/AddLLD.cmake -+++ b/cmake/modules/AddLLD.cmake -@@ -18,8 +18,8 @@ macro(add_lld_library name) - install(TARGETS ${name} - COMPONENT ${name} - ${export_to_lldtargets} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} -+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" -+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - - if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) -@@ -62,5 +62,5 @@ endmacro() - macro(add_lld_symlink name dest) - add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) - # Always generate install targets -- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) -+ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) - endmacro() diff --git a/pkgs/development/compilers/llvm/14/llvm/gnu-install-dirs-polly.patch b/pkgs/development/compilers/llvm/14/llvm/gnu-install-dirs-polly.patch deleted file mode 100644 index b01363e98aa0..000000000000 --- a/pkgs/development/compilers/llvm/14/llvm/gnu-install-dirs-polly.patch +++ /dev/null @@ -1,19 +0,0 @@ -This is the one remaining Polly install dirs related change that hasn't made it -into upstream yet; previously this patch file also included: -https://reviews.llvm.org/D117541 - -diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake -index 518a09b45a42..bd9d6f5542ad 100644 ---- a/tools/polly/cmake/polly_macros.cmake -+++ b/tools/polly/cmake/polly_macros.cmake -@@ -44,8 +44,8 @@ macro(add_polly_library name) - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly") - install(TARGETS ${name} - EXPORT LLVMExports -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) - endif() - set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) - endmacro(add_polly_library) diff --git a/pkgs/development/compilers/llvm/14/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/14/llvm/gnu-install-dirs.patch deleted file mode 100644 index 55862ab39304..000000000000 --- a/pkgs/development/compilers/llvm/14/llvm/gnu-install-dirs.patch +++ /dev/null @@ -1,220 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index fec956091cd5..5a766f5c5d7c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -303,6 +303,9 @@ set(LLVM_EXAMPLES_INSTALL_DIR "examples" CACHE STRING - "Path for examples subdirectory (enabled by LLVM_BUILD_EXAMPLES=ON) (defaults to 'examples')") - mark_as_advanced(LLVM_EXAMPLES_INSTALL_DIR) - -+set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING -+ "Path for CMake subdirectory (defaults to lib/cmake/llvm)" ) -+ - # They are used as destination of target generators. - set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) - set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) -diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake -index fed1fec7d72e..4baed19b9e98 100644 ---- a/cmake/modules/AddLLVM.cmake -+++ b/cmake/modules/AddLLVM.cmake -@@ -838,8 +838,8 @@ macro(add_llvm_library name) - get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella}) - install(TARGETS ${name} - ${export_to_llvmexports} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name} -+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name} - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name}) - - if (NOT LLVM_ENABLE_IDE) -@@ -1056,7 +1056,7 @@ function(process_llvm_pass_plugins) - "set(LLVM_STATIC_EXTENSIONS ${LLVM_STATIC_EXTENSIONS})") - install(FILES - ${llvm_cmake_builddir}/LLVMConfigExtensions.cmake -- DESTINATION ${LLVM_INSTALL_PACKAGE_DIR} -+ DESTINATION ${LLVM_INSTALL_CMAKE_DIR} - COMPONENT cmake-exports) - - set(ExtensionDef "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def") -@@ -1902,7 +1902,7 @@ function(llvm_install_library_symlink name dest type) - set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) - set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) - -- set(output_dir lib${LLVM_LIBDIR_SUFFIX}) -+ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) - if(WIN32 AND "${type}" STREQUAL "SHARED") - set(output_dir bin) - endif() -@@ -1913,7 +1913,7 @@ function(llvm_install_library_symlink name dest type) - - endfunction() - --function(llvm_install_symlink name dest) -+function(llvm_install_symlink name dest output_dir) - cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN}) - foreach(path ${CMAKE_MODULE_PATH}) - if(EXISTS ${path}/LLVMInstallSymlink.cmake) -@@ -1936,7 +1936,7 @@ function(llvm_install_symlink name dest) - set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX}) - - install(SCRIPT ${INSTALL_SYMLINK} -- CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})" -+ CODE "install_symlink(${full_name} ${full_dest} ${output_dir})" - COMPONENT ${component}) - - if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE) -@@ -2019,7 +2019,8 @@ function(add_llvm_tool_symlink link_name target) - endif() - - if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS) -- llvm_install_symlink(${link_name} ${target}) -+ GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR) -+ llvm_install_symlink(${link_name} ${target} ${output_dir}) - endif() - endif() - endfunction() -@@ -2148,9 +2149,9 @@ function(llvm_setup_rpath name) - # Since BUILD_SHARED_LIBS is only recommended for use by developers, - # hardcode the rpath to build/install lib dir first in this mode. - # FIXME: update this when there is better solution. -- set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -+ set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) - elseif(UNIX) -- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -+ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) - if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") - set_property(TARGET ${name} APPEND_STRING PROPERTY - LINK_FLAGS " -Wl,-z,origin ") -diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake -index 891c9e6d618c..8d963f3b0069 100644 ---- a/cmake/modules/AddOCaml.cmake -+++ b/cmake/modules/AddOCaml.cmake -@@ -147,9 +147,9 @@ function(add_ocaml_library name) - endforeach() - - if( APPLE ) -- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") -+ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") - elseif( UNIX ) -- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") -+ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") - endif() - list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") - -diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt -index cea0c1df0a14..eedcd9450312 100644 ---- a/cmake/modules/CMakeLists.txt -+++ b/cmake/modules/CMakeLists.txt -@@ -2,7 +2,7 @@ include(ExtendPath) - include(LLVMDistributionSupport) - include(FindPrefixFromConfig) - --set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) -+set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')") - set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") - - # First for users who use an installed LLVM, create the LLVMExports.cmake file. -@@ -122,7 +122,7 @@ set(LLVM_CONFIG_INCLUDE_DIRS - ) - list(REMOVE_DUPLICATES LLVM_CONFIG_INCLUDE_DIRS) - --extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "lib\${LLVM_LIBDIR_SUFFIX}") -+extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") - set(LLVM_CONFIG_LIBRARY_DIRS - "${LLVM_CONFIG_LIBRARY_DIR}" - # FIXME: Should there be other entries here? -diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake -index b5c35f706cb7..9261ab797de6 100644 ---- a/cmake/modules/LLVMInstallSymlink.cmake -+++ b/cmake/modules/LLVMInstallSymlink.cmake -@@ -6,7 +6,7 @@ include(GNUInstallDirs) - - function(install_symlink name target outdir) - set(DESTDIR $ENV{DESTDIR}) -- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}") -+ set(bindir "${DESTDIR}${outdir}/") - - message(STATUS "Creating ${name}") - -diff --git a/docs/CMake.rst b/docs/CMake.rst -index 044ec8a4d39d..504d0eac3ade 100644 ---- a/docs/CMake.rst -+++ b/docs/CMake.rst -@@ -224,7 +224,7 @@ description is in `LLVM-related variables`_ below. - **LLVM_LIBDIR_SUFFIX**:STRING - Extra suffix to append to the directory where libraries are to be - installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` -- to install libraries to ``/usr/lib64``. -+ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. - - **LLVM_PARALLEL_{COMPILE,LINK}_JOBS**:STRING - Building the llvm toolchain can use a lot of resources, particularly -@@ -910,9 +910,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``). - - This file is available in two different locations. - --* ``/lib/cmake/llvm/LLVMConfig.cmake`` where -- ```` is the install prefix of an installed version of LLVM. -- On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. -+* ``LLVMConfig.cmake`` where -+ ```` is the location where LLVM CMake modules are -+ installed as part of an installed version of LLVM. This is typically -+ ``cmake/llvm/`` within the lib directory. On Linux, this is typically -+ ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. - - * ``/lib/cmake/llvm/LLVMConfig.cmake`` where - ```` is the root of the LLVM build tree. **Note: this is only -diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt -index b46319f24fc8..2feabd1954e4 100644 ---- a/include/llvm/CMakeLists.txt -+++ b/include/llvm/CMakeLists.txt -@@ -5,5 +5,5 @@ add_subdirectory(Frontend) - # If we're doing an out-of-tree build, copy a module map for generated - # header files into the build area. - if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") -- configure_file(module.modulemap.build module.modulemap COPYONLY) -+ configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY) - endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") -diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in -index abbb8a450da6..70c497be12f5 100644 ---- a/tools/llvm-config/BuildVariables.inc.in -+++ b/tools/llvm-config/BuildVariables.inc.in -@@ -23,7 +23,10 @@ - #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" - #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" - #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" -+#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@" -+#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" - #define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" -+#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@" - #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" - #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" - #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" -diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp -index 8ed88f33ead4..5e7184bab90d 100644 ---- a/tools/llvm-config/llvm-config.cpp -+++ b/tools/llvm-config/llvm-config.cpp -@@ -363,12 +363,20 @@ int main(int argc, char **argv) { - ActiveIncludeDir = std::string(Path.str()); - } - { -- SmallString<256> Path(LLVM_TOOLS_INSTALL_DIR); -+ SmallString<256> Path(LLVM_INSTALL_BINDIR); - sys::fs::make_absolute(ActivePrefix, Path); - ActiveBinDir = std::string(Path.str()); - } -- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; -- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; -+ { -+ SmallString<256> Path(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX); -+ sys::fs::make_absolute(ActivePrefix, Path); -+ ActiveLibDir = std::string(Path.str()); -+ } -+ { -+ SmallString<256> Path(LLVM_INSTALL_CMAKEDIR); -+ sys::fs::make_absolute(ActivePrefix, Path); -+ ActiveCMakeDir = std::string(Path.str()); -+ } - ActiveIncludeOption = "-I" + ActiveIncludeDir; - } - diff --git a/pkgs/development/compilers/llvm/14/openmp/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/14/openmp/gnu-install-dirs.patch deleted file mode 100644 index e85fde46ca3f..000000000000 --- a/pkgs/development/compilers/llvm/14/openmp/gnu-install-dirs.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -24,7 +24,7 @@ if (OPENMP_STANDALONE_BUILD) - set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING - "Suffix of lib installation directory, e.g. 64 => lib64") - # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. -- set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") -+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}") - - # Group test settings. - set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING -@@ -35,7 +35,7 @@ if (OPENMP_STANDALONE_BUILD) - else() - set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) - # If building in tree, we honor the same install suffix LLVM uses. -- set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}") -+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") - - if (NOT MSVC) - set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang) -diff --git a/libomptarget/plugins/amdgpu/CMakeLists.txt b/libomptarget/plugins/amdgpu/CMakeLists.txt ---- a/libomptarget/plugins/amdgpu/CMakeLists.txt -+++ b/libomptarget/plugins/amdgpu/CMakeLists.txt -@@ -74,7 +74,7 @@ add_library(omptarget.rtl.amdgpu SHARED - - # Install plugin under the lib destination folder. - # When we build for debug, OPENMP_LIBDIR_SUFFIX get set to -debug --install(TARGETS omptarget.rtl.amdgpu LIBRARY DESTINATION "lib${OPENMP_LIBDIR_SUFFIX}") -+install(TARGETS omptarget.rtl.amdgpu LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}") - set_property(TARGET omptarget.rtl.amdgpu PROPERTY INSTALL_RPATH_USE_LINK_PATH ON) - - if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") -diff --git a/libomptarget/plugins/ve/CMakeLists.txt b/libomptarget/plugins/ve/CMakeLists.txt ---- a/libomptarget/plugins/ve/CMakeLists.txt -+++ b/libomptarget/plugins/ve/CMakeLists.txt -@@ -32,7 +32,7 @@ if(${LIBOMPTARGET_DEP_VEO_FOUND}) - - # Install plugin under the lib destination folder. - install(TARGETS "omptarget.rtl.${tmachine_libname}" -- LIBRARY DESTINATION lib${OPENMP_LIBDIR_SUFFIX}) -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}) - - target_link_libraries( - "omptarget.rtl.${tmachine_libname}" diff --git a/pkgs/development/compilers/llvm/14/openmp/run-lit-directly.patch b/pkgs/development/compilers/llvm/14/openmp/run-lit-directly.patch deleted file mode 100644 index 1e952fdc36a8..000000000000 --- a/pkgs/development/compilers/llvm/14/openmp/run-lit-directly.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/cmake/OpenMPTesting.cmake b/cmake/OpenMPTesting.cmake ---- a/cmake/OpenMPTesting.cmake -+++ b/cmake/OpenMPTesting.cmake -@@ -185,7 +185,7 @@ function(add_openmp_testsuite target comment) - if (${OPENMP_STANDALONE_BUILD}) - set(LIT_ARGS ${OPENMP_LIT_ARGS} ${ARG_ARGS}) - add_custom_target(${target} -- COMMAND ${PYTHON_EXECUTABLE} ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS} -+ COMMAND ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS} - COMMENT ${comment} - DEPENDS ${ARG_DEPENDS} - USES_TERMINAL diff --git a/pkgs/development/compilers/llvm/15/clang/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/15/clang/gnu-install-dirs.patch deleted file mode 100644 index f767c56836d5..000000000000 --- a/pkgs/development/compilers/llvm/15/clang/gnu-install-dirs.patch +++ /dev/null @@ -1,105 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c27beec313d7..480f13e73c9f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -78,15 +78,17 @@ if(CLANG_BUILT_STANDALONE) - if (NOT LLVM_CONFIG_FOUND) - # Pull values from LLVMConfig.cmake. We can drop this once the llvm-config - # path is removed. -- set(MAIN_INCLUDE_DIR "${LLVM_INCLUDE_DIR}") -+ set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS}) - set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}") - # N.B. this is just a default value, the CACHE PATHs below can be overriden. - set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm") - set(TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}") - set(LIBRARY_DIR "${LLVM_LIBRARY_DIR}") -+ else() -+ set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}") - endif() - -- set(LLVM_MAIN_INCLUDE_DIR "${MAIN_INCLUDE_DIR}" CACHE PATH "Path to llvm/include") -+ set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed") - set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree") - set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree") - set(LLVM_TOOLS_BINARY_DIR "${TOOLS_BINARY_DIR}" CACHE PATH "Path to llvm/bin") -@@ -128,7 +130,7 @@ if(CLANG_BUILT_STANDALONE) - set(LLVM_INCLUDE_TESTS ON) - endif() - -- include_directories("${LLVM_BINARY_DIR}/include" "${LLVM_MAIN_INCLUDE_DIR}") -+ include_directories(${LLVM_INCLUDE_DIRS}) - link_directories("${LLVM_LIBRARY_DIR}") - - set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) -diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake -index 21ac332e4f5f..b16c314bd1e2 100644 ---- a/cmake/modules/AddClang.cmake -+++ b/cmake/modules/AddClang.cmake -@@ -119,8 +119,8 @@ macro(add_clang_library name) - install(TARGETS ${lib} - COMPONENT ${lib} - ${export_to_clangtargets} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} -+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" -+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - - if (NOT LLVM_ENABLE_IDE) -diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt -index 6e2060991b92..b9bc930d26b8 100644 ---- a/lib/Headers/CMakeLists.txt -+++ b/lib/Headers/CMakeLists.txt -@@ -420,7 +420,7 @@ add_header_target("openmp-resource-headers" ${openmp_wrapper_files}) - add_header_target("windows-resource-headers" ${windows_only_files}) - add_header_target("utility-resource-headers" ${utility_files}) - --set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) -+set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) - - ############################################################# - # Install rules for the catch-all clang-resource-headers target -diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt -index 8d95d0900e8c..ebc70ff7526d 100644 ---- a/tools/libclang/CMakeLists.txt -+++ b/tools/libclang/CMakeLists.txt -@@ -180,7 +180,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS}) - COMPONENT - libclang-python-bindings - DESTINATION -- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") -+ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") - endforeach() - if(NOT LLVM_ENABLE_IDE) - add_custom_target(libclang-python-bindings) -diff --git a/tools/scan-build-py/CMakeLists.txt b/tools/scan-build-py/CMakeLists.txt -index 061dc7ef4dd9..adc54b2edc32 100644 ---- a/tools/scan-build-py/CMakeLists.txt -+++ b/tools/scan-build-py/CMakeLists.txt -@@ -88,7 +88,7 @@ foreach(lib ${LibScanbuild}) - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib}) - list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib}) - install(PROGRAMS lib/libscanbuild/${lib} -- DESTINATION lib/libscanbuild -+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild" - COMPONENT scan-build-py) - endforeach() - -@@ -106,7 +106,7 @@ foreach(resource ${LibScanbuildResources}) - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource}) - list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource}) - install(PROGRAMS lib/libscanbuild/resources/${resource} -- DESTINATION lib/libscanbuild/resources -+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild/resources" - COMPONENT scan-build-py) - endforeach() - -@@ -122,7 +122,7 @@ foreach(lib ${LibEar}) - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib}) - list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib}) - install(PROGRAMS lib/libear/${lib} -- DESTINATION lib/libear -+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libear" - COMPONENT scan-build-py) - endforeach() - diff --git a/pkgs/development/compilers/llvm/15/clang/purity.patch b/pkgs/development/compilers/llvm/15/clang/purity.patch deleted file mode 100644 index 1c94f293eb93..000000000000 --- a/pkgs/development/compilers/llvm/15/clang/purity.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 4add81bba40dcec62c4ea4481be8e35ac53e89d8 Mon Sep 17 00:00:00 2001 -From: Will Dietz -Date: Thu, 18 May 2017 11:56:12 -0500 -Subject: [PATCH] "purity" patch for 5.0 - ---- - lib/Driver/ToolChains/Gnu.cpp | 7 ------- - 1 file changed, 7 deletions(-) - -diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp -index fe3c0191bb..c6a482bece 100644 ---- a/lib/Driver/ToolChains/Gnu.cpp -+++ b/lib/Driver/ToolChains/Gnu.cpp -@@ -487,13 +487,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, - } else { - if (Args.hasArg(options::OPT_rdynamic)) - CmdArgs.push_back("-export-dynamic"); - -- if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE && -- !Args.hasArg(options::OPT_r)) { -- CmdArgs.push_back("-dynamic-linker"); -- CmdArgs.push_back(Args.MakeArgString(Twine(D.DyldPrefix) + -- ToolChain.getDynamicLinker(Args))); -- } - } - - CmdArgs.push_back("-o"); --- -2.11.0 diff --git a/pkgs/development/compilers/llvm/15/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/15/compiler-rt/gnu-install-dirs.patch deleted file mode 100644 index f3b1f63a7d71..000000000000 --- a/pkgs/development/compilers/llvm/15/compiler-rt/gnu-install-dirs.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake -index 8a6219568b3f..30ee68a47ccf 100644 ---- a/cmake/base-config-ix.cmake -+++ b/cmake/base-config-ix.cmake -@@ -100,13 +100,13 @@ endif() - if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) - set(COMPILER_RT_OUTPUT_LIBRARY_DIR - ${COMPILER_RT_OUTPUT_DIR}/lib) -- extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" lib) -+ extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}") - set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH - "Path where built compiler-rt libraries should be installed.") - else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) - set(COMPILER_RT_OUTPUT_LIBRARY_DIR - ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) -- extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "lib/${COMPILER_RT_OS_DIR}") -+ extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}/${COMPILER_RT_OS_DIR}") - set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH - "Path where built compiler-rt libraries should be installed.") - endif() diff --git a/pkgs/development/compilers/llvm/15/libunwind/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/15/libunwind/gnu-install-dirs.patch deleted file mode 100644 index edfb2a8760bd..000000000000 --- a/pkgs/development/compilers/llvm/15/libunwind/gnu-install-dirs.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5a06805f05f1..86a50329e6a8 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -117,7 +117,7 @@ set(LIBUNWIND_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH - - if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) - set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}) -- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH -+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH - "Path where built libunwind libraries should be installed.") - if(LIBCXX_LIBDIR_SUBDIR) - string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) -@@ -129,7 +129,7 @@ else() - else() - set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX}) - endif() -- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX} CACHE PATH -+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX} CACHE PATH - "Path where built libunwind libraries should be installed.") - endif() - diff --git a/pkgs/development/compilers/llvm/15/lld/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/15/lld/gnu-install-dirs.patch deleted file mode 100644 index ea62b2ad50c7..000000000000 --- a/pkgs/development/compilers/llvm/15/lld/gnu-install-dirs.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index dcc649629a4b..58dca54642e4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -70,13 +70,15 @@ if(LLD_BUILT_STANDALONE) - if (NOT LLVM_CONFIG_FOUND) - # Pull values from LLVMConfig.cmake. We can drop this once the llvm-config - # path is removed. -- set(MAIN_INCLUDE_DIR "${LLVM_INCLUDE_DIR}") -+ set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS}) - set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}") - # N.B. this is just a default value, the CACHE PATHs below can be overridden. - set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm") -+ else() -+ set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}") - endif() - -- set(LLVM_MAIN_INCLUDE_DIR "${MAIN_INCLUDE_DIR}" CACHE PATH "Path to llvm/include") -+ set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed") - set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree") - set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree") - -@@ -95,7 +97,7 @@ if(LLD_BUILT_STANDALONE) - - set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}") - -- include_directories("${LLVM_BINARY_DIR}/include" ${LLVM_INCLUDE_DIRS}) -+ include_directories(${LLVM_INCLUDE_DIRS}) - link_directories(${LLVM_LIBRARY_DIRS}) - - if(LLVM_INCLUDE_TESTS) -diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake -index d3924f7243d4..42a7cd62281c 100644 ---- a/cmake/modules/AddLLD.cmake -+++ b/cmake/modules/AddLLD.cmake -@@ -18,8 +18,8 @@ macro(add_lld_library name) - install(TARGETS ${name} - COMPONENT ${name} - ${export_to_lldtargets} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} -+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" -+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - - if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) diff --git a/pkgs/development/compilers/llvm/15/lldb/procfs.patch b/pkgs/development/compilers/llvm/15/lldb/procfs.patch deleted file mode 100644 index 7b200e86505c..000000000000 --- a/pkgs/development/compilers/llvm/15/lldb/procfs.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- a/source/Plugins/Process/Linux/Procfs.h -+++ b/source/Plugins/Process/Linux/Procfs.h -@@ -10,6 +10,13 @@ - // sys/procfs.h on Android/Linux for all supported architectures. - - #include -+#include -+ -+// on i686 preprocessor symbols with these register names are defined as -+// numeric constants; these symbols clash with identifier names used in -+// `llvm/Support/VirtualFileSystem.h` and `llvm/ADT/SmallVector.h` -+#undef FS -+#undef CS - - #include "lldb/lldb-types.h" - -@@ -17,23 +24,13 @@ - - #include - --#ifdef __ANDROID__ --#if defined(__arm64__) || defined(__aarch64__) --typedef unsigned long elf_greg_t; --typedef elf_greg_t -- elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))]; --typedef struct user_fpsimd_state elf_fpregset_t; --#ifndef NT_FPREGSET --#define NT_FPREGSET NT_PRFPREG --#endif // NT_FPREGSET --#elif defined(__mips__) --#ifndef NT_FPREGSET --#define NT_FPREGSET NT_PRFPREG --#endif // NT_FPREGSET --#endif --#else // __ANDROID__ -+#if !defined(__GLIBC__) && defined(__powerpc__) -+#define pt_regs musl_pt_regs -+#include -+#undef pt_regs -+#else - #include --#endif // __ANDROID__ -+#endif - - namespace lldb_private { - namespace process_linux { diff --git a/pkgs/development/compilers/llvm/15/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/15/llvm/gnu-install-dirs.patch deleted file mode 100644 index 0ef317af8cc7..000000000000 --- a/pkgs/development/compilers/llvm/15/llvm/gnu-install-dirs.patch +++ /dev/null @@ -1,138 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 45399dc0537e..5d946e9e6583 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -942,7 +942,7 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "") - add_subdirectory(${TENSORFLOW_AOT_PATH}/xla_aot_runtime_src - ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime) - install(TARGETS tf_xla_runtime EXPORT LLVMExports -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime) -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime) - set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS tf_xla_runtime) - # Once we add more modules, we should handle this more automatically. - if (DEFINED LLVM_OVERRIDE_MODEL_HEADER_INLINERSIZEMODEL) -diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake -index 057431208322..56f0dcb258da 100644 ---- a/cmake/modules/AddLLVM.cmake -+++ b/cmake/modules/AddLLVM.cmake -@@ -844,8 +844,8 @@ macro(add_llvm_library name) - get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella}) - install(TARGETS ${name} - ${export_to_llvmexports} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name} -+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name} - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name}) - - if (NOT LLVM_ENABLE_IDE) -@@ -2007,7 +2007,7 @@ function(llvm_install_library_symlink name dest type) - set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) - set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) - -- set(output_dir lib${LLVM_LIBDIR_SUFFIX}) -+ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) - if(WIN32 AND "${type}" STREQUAL "SHARED") - set(output_dir "${CMAKE_INSTALL_BINDIR}") - endif() -@@ -2271,15 +2271,15 @@ function(llvm_setup_rpath name) - - if (APPLE) - set(_install_name_dir INSTALL_NAME_DIR "@rpath") -- set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -+ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) - elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX" AND BUILD_SHARED_LIBS) - # $ORIGIN is not interpreted at link time by aix ld. - # Since BUILD_SHARED_LIBS is only recommended for use by developers, - # hardcode the rpath to build/install lib dir first in this mode. - # FIXME: update this when there is better solution. -- set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -+ set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) - elseif(UNIX) -- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -+ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) - if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") - set_property(TARGET ${name} APPEND_STRING PROPERTY - LINK_FLAGS " -Wl,-z,origin ") -diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake -index 891c9e6d618c..8d963f3b0069 100644 ---- a/cmake/modules/AddOCaml.cmake -+++ b/cmake/modules/AddOCaml.cmake -@@ -147,9 +147,9 @@ function(add_ocaml_library name) - endforeach() - - if( APPLE ) -- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") -+ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") - elseif( UNIX ) -- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") -+ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") - endif() - list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") - -diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt -index d4b0ab959148..26ed981fd09f 100644 ---- a/cmake/modules/CMakeLists.txt -+++ b/cmake/modules/CMakeLists.txt -@@ -128,7 +128,7 @@ set(LLVM_CONFIG_INCLUDE_DIRS - ) - list(REMOVE_DUPLICATES LLVM_CONFIG_INCLUDE_DIRS) - --extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "lib\${LLVM_LIBDIR_SUFFIX}") -+extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") - set(LLVM_CONFIG_LIBRARY_DIRS - "${LLVM_CONFIG_LIBRARY_DIR}" - # FIXME: Should there be other entries here? -diff --git a/docs/CMake.rst b/docs/CMake.rst -index 879b7b231d4c..9c31d14e8950 100644 ---- a/docs/CMake.rst -+++ b/docs/CMake.rst -@@ -250,7 +250,7 @@ description is in `LLVM-related variables`_ below. - **LLVM_LIBDIR_SUFFIX**:STRING - Extra suffix to append to the directory where libraries are to be - installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` -- to install libraries to ``/usr/lib64``. -+ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. - - **LLVM_PARALLEL_{COMPILE,LINK}_JOBS**:STRING - Building the llvm toolchain can use a lot of resources, particularly -@@ -284,6 +284,10 @@ manual, or execute ``cmake --help-variable VARIABLE_NAME``. - The path to install executables, relative to the *CMAKE_INSTALL_PREFIX*. - Defaults to "bin". - -+**CMAKE_INSTALL_LIBDIR**:PATH -+ The path to install libraries, relative to the *CMAKE_INSTALL_PREFIX*. -+ Defaults to "lib". -+ - **CMAKE_INSTALL_INCLUDEDIR**:PATH - The path to install header files, relative to the *CMAKE_INSTALL_PREFIX*. - Defaults to "include". -diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in -index 370005cd8d7d..7e790bc52111 100644 ---- a/tools/llvm-config/BuildVariables.inc.in -+++ b/tools/llvm-config/BuildVariables.inc.in -@@ -23,6 +23,7 @@ - #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" - #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" - #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" -+#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" - #define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" - #define LLVM_INSTALL_PACKAGE_DIR "@LLVM_INSTALL_PACKAGE_DIR@" - #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" -diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp -index 2c6c55f89d38..f6d2068a0827 100644 ---- a/tools/llvm-config/llvm-config.cpp -+++ b/tools/llvm-config/llvm-config.cpp -@@ -369,7 +369,11 @@ int main(int argc, char **argv) { - sys::fs::make_absolute(ActivePrefix, Path); - ActiveBinDir = std::string(Path.str()); - } -- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; -+ { -+ SmallString<256> Path(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX); -+ sys::fs::make_absolute(ActivePrefix, Path); -+ ActiveLibDir = std::string(Path.str()); -+ } - { - SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR); - sys::fs::make_absolute(ActivePrefix, Path); diff --git a/pkgs/development/compilers/llvm/15/llvm/lit-shell-script-runner-set-dyld-library-path.patch b/pkgs/development/compilers/llvm/15/llvm/lit-shell-script-runner-set-dyld-library-path.patch deleted file mode 100644 index 32f1d13a9dc2..000000000000 --- a/pkgs/development/compilers/llvm/15/llvm/lit-shell-script-runner-set-dyld-library-path.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py -index 0242e0b75af3..d732011306f7 100644 ---- a/utils/lit/lit/TestRunner.py -+++ b/utils/lit/lit/TestRunner.py -@@ -1029,6 +1029,12 @@ def executeScript(test, litConfig, tmpBase, commands, cwd): - f.write('@echo off\n') - f.write('\n@if %ERRORLEVEL% NEQ 0 EXIT\n'.join(commands)) - else: -+ # This env var is *purged* when invoking subprocesses so we have to -+ # manually set it from within the bash script in order for the commands -+ # in run lines to see this var: -+ if "DYLD_LIBRARY_PATH" in test.config.environment: -+ f.write(f'export DYLD_LIBRARY_PATH="{test.config.environment["DYLD_LIBRARY_PATH"]}"\n') -+ - for i, ln in enumerate(commands): - match = re.match(kPdbgRegex, ln) - if match: -@@ -1363,7 +1369,7 @@ def applySubstitutions(script, substitutions, conditions={}, - return processed - - process = processLine if recursion_limit is None else processLineToFixedPoint -- -+ - return [unescapePercents(process(ln)) for ln in script] - - diff --git a/pkgs/development/compilers/llvm/15/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch b/pkgs/development/compilers/llvm/15/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch deleted file mode 100644 index d824516c0a16..000000000000 --- a/pkgs/development/compilers/llvm/15/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch +++ /dev/null @@ -1,79 +0,0 @@ -diff --git a/test/Unit/lit.cfg.py b/test/Unit/lit.cfg.py -index 81e8dc04acea..479ff95681e2 100644 ---- a/test/Unit/lit.cfg.py -+++ b/test/Unit/lit.cfg.py -@@ -3,6 +3,7 @@ - # Configuration file for the 'lit' test runner. - - import os -+import platform - import subprocess - - import lit.formats -@@ -55,3 +56,26 @@ if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir): - # Win32 may use %SYSTEMDRIVE% during file system shell operations, so propogate. - if sys.platform == 'win32' and 'SYSTEMDRIVE' in os.environ: - config.environment['SYSTEMDRIVE'] = os.environ['SYSTEMDRIVE'] -+ -+# Add the LLVM dynamic libs to the platform-specific loader search path env var: -+# -+# TODO: this is copied from `clang`'s `lit.cfg.py`; should unify.. -+def find_shlibpath_var(): -+ if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'OpenBSD', 'SunOS']: -+ yield 'LD_LIBRARY_PATH' -+ elif platform.system() == 'Darwin': -+ yield 'DYLD_LIBRARY_PATH' -+ elif platform.system() == 'Windows': -+ yield 'PATH' -+ elif platform.system() == 'AIX': -+ yield 'LIBPATH' -+ -+for shlibpath_var in find_shlibpath_var(): -+ shlibpath = os.path.pathsep.join( -+ (config.shlibdir, -+ config.environment.get(shlibpath_var, ''))) -+ config.environment[shlibpath_var] = shlibpath -+ break -+else: -+ lit_config.warning("unable to inject shared library path on '{}'" -+ .format(platform.system())) -diff --git a/test/lit.cfg.py b/test/lit.cfg.py -index 75a38b4c5dad..856fc75c9d74 100644 ---- a/test/lit.cfg.py -+++ b/test/lit.cfg.py -@@ -42,6 +42,26 @@ llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True) - llvm_config.with_system_environment( - ['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP']) - -+# Add the LLVM dynamic libs to the platform-specific loader search path env var: -+# -+# TODO: this is copied from `clang`'s `lit.cfg.py`; should unify.. -+def find_shlibpath_var(): -+ if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'OpenBSD', 'SunOS']: -+ yield 'LD_LIBRARY_PATH' -+ elif platform.system() == 'Darwin': -+ yield 'DYLD_LIBRARY_PATH' -+ elif platform.system() == 'Windows': -+ yield 'PATH' -+ elif platform.system() == 'AIX': -+ yield 'LIBPATH' -+ -+for shlibpath_var in find_shlibpath_var(): -+ shlibpath = config.llvm_shlib_dir -+ llvm_config.with_environment(shlibpath_var, shlibpath, append_path = True) -+ break -+else: -+ lit_config.warning("unable to inject shared library path on '{}'" -+ .format(platform.system())) - - # Set up OCAMLPATH to include newly built OCaml libraries. - top_ocaml_lib = os.path.join(config.llvm_lib_dir, 'ocaml') -@@ -318,7 +338,7 @@ def have_cxx_shared_library(): - - try: - readobj_cmd = subprocess.Popen( -- [readobj_exe, '--needed-libs', readobj_exe], stdout=subprocess.PIPE) -+ [readobj_exe, '--needed-libs', readobj_exe], stdout=subprocess.PIPE, env=config.environment) - except OSError: - print('could not exec llvm-readobj') - return False diff --git a/pkgs/development/compilers/llvm/15/openmp/fix-find-tool.patch b/pkgs/development/compilers/llvm/15/openmp/fix-find-tool.patch deleted file mode 100644 index 103b054ed176..000000000000 --- a/pkgs/development/compilers/llvm/15/openmp/fix-find-tool.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/libomptarget/DeviceRTL/CMakeLists.txt b/libomptarget/DeviceRTL/CMakeLists.txt -index ce66214822a2..6ab7b33c95da 100644 ---- a/libomptarget/DeviceRTL/CMakeLists.txt -+++ b/libomptarget/DeviceRTL/CMakeLists.txt -@@ -27,10 +27,10 @@ endif() - if (LLVM_DIR) - # Builds that use pre-installed LLVM have LLVM_DIR set. - # A standalone or LLVM_ENABLE_RUNTIMES=openmp build takes this route -- find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) -+ find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR}) - find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR} -- NO_DEFAULT_PATH) -- find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) -+ ) -+ find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR}) - if ((NOT CLANG_TOOL) OR (NOT LINK_TOOL) OR (NOT OPT_TOOL)) - libomptarget_say("Not building DeviceRTL. Missing clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL} or opt: ${OPT_TOOL}") - return() diff --git a/pkgs/development/compilers/llvm/15/openmp/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/15/openmp/gnu-install-dirs.patch deleted file mode 100644 index 77a93208832a..000000000000 --- a/pkgs/development/compilers/llvm/15/openmp/gnu-install-dirs.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b6ddbe90516d..311ab1d50e7f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -29,7 +29,7 @@ if (OPENMP_STANDALONE_BUILD) - set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING - "Suffix of lib installation directory, e.g. 64 => lib64") - # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. -- set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") -+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}") - - # Group test settings. - set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING -@@ -40,7 +40,7 @@ if (OPENMP_STANDALONE_BUILD) - else() - set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) - # If building in tree, we honor the same install suffix LLVM uses. -- set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}") -+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") - - if (NOT MSVC) - set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang) diff --git a/pkgs/development/compilers/llvm/16/clang/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/16/clang/gnu-install-dirs.patch deleted file mode 100644 index e5465c9bf4f9..000000000000 --- a/pkgs/development/compilers/llvm/16/clang/gnu-install-dirs.patch +++ /dev/null @@ -1,109 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 090cfa352078..624b7c9f3400 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -38,12 +38,26 @@ if(CLANG_BUILT_STANDALONE) - find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}") - list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}") - -- # Turn into CACHE PATHs for overwritting -- set(LLVM_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed") -- set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}" CACHE PATH "Path to LLVM build tree") -- set(LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm" CACHE PATH "Path to LLVM source tree") -- set(LLVM_TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}" CACHE PATH "Path to llvm/bin") -- set(LLVM_LIBRARY_DIR "${LLVM_LIBRARY_DIR}" CACHE PATH "Path to llvm/lib") -+ # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets -+ # LLVM_CONFIG. -+ if (NOT LLVM_CONFIG_FOUND) -+ # Pull values from LLVMConfig.cmake. We can drop this once the llvm-config -+ # path is removed. -+ set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS}) -+ set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}") -+ # N.B. this is just a default value, the CACHE PATHs below can be overriden. -+ set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm") -+ set(TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}") -+ set(LIBRARY_DIR "${LLVM_LIBRARY_DIR}") -+ else() -+ set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}") -+ endif() -+ -+ set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed") -+ set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree") -+ set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree") -+ set(LLVM_TOOLS_BINARY_DIR "${TOOLS_BINARY_DIR}" CACHE PATH "Path to llvm/bin") -+ set(LLVM_LIBRARY_DIR "${LIBRARY_DIR}" CACHE PATH "Path to llvm/lib") - - find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR} - NO_DEFAULT_PATH) -diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake -index 75b0080f6715..c895b884cd27 100644 ---- a/cmake/modules/AddClang.cmake -+++ b/cmake/modules/AddClang.cmake -@@ -119,8 +119,8 @@ macro(add_clang_library name) - install(TARGETS ${lib} - COMPONENT ${lib} - ${export_to_clangtargets} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} -+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" -+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - - if (NOT LLVM_ENABLE_IDE) -diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt -index bb9a11eabbef..e2de91c65fbb 100644 ---- a/lib/Headers/CMakeLists.txt -+++ b/lib/Headers/CMakeLists.txt -@@ -437,7 +437,7 @@ add_header_target("openmp-resource-headers" ${openmp_wrapper_files}) - add_header_target("windows-resource-headers" ${windows_only_files}) - add_header_target("utility-resource-headers" ${utility_files}) - --set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION_MAJOR}/include) -+set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION_MAJOR}/include) - - ############################################################# - # Install rules for the catch-all clang-resource-headers target -diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt -index 4f23065a2472..6a0f55991e24 100644 ---- a/tools/libclang/CMakeLists.txt -+++ b/tools/libclang/CMakeLists.txt -@@ -234,7 +234,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS}) - COMPONENT - libclang-python-bindings - DESTINATION -- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") -+ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") - endforeach() - if(NOT LLVM_ENABLE_IDE) - add_custom_target(libclang-python-bindings) -diff --git a/tools/scan-build-py/CMakeLists.txt b/tools/scan-build-py/CMakeLists.txt -index 3aca22c0b0a8..3115353e3fe3 100644 ---- a/tools/scan-build-py/CMakeLists.txt -+++ b/tools/scan-build-py/CMakeLists.txt -@@ -88,7 +88,7 @@ foreach(lib ${LibScanbuild}) - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib}) - list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib}) - install(FILES lib/libscanbuild/${lib} -- DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libscanbuild -+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild" - COMPONENT scan-build-py) - endforeach() - -@@ -106,7 +106,7 @@ foreach(resource ${LibScanbuildResources}) - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource}) - list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource}) - install(FILES lib/libscanbuild/resources/${resource} -- DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libscanbuild/resources -+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild/resources" - COMPONENT scan-build-py) - endforeach() - -@@ -122,7 +122,7 @@ foreach(lib ${LibEar}) - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib}) - list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib}) - install(FILES lib/libear/${lib} -- DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libear -+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libear" - COMPONENT scan-build-py) - endforeach() - diff --git a/pkgs/development/compilers/llvm/16/compiler-rt/asan-offset.patch b/pkgs/development/compilers/llvm/16/compiler-rt/asan-offset.patch deleted file mode 100644 index 46afe5c00734..000000000000 --- a/pkgs/development/compilers/llvm/16/compiler-rt/asan-offset.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/lib/asan/CMakeLists.txt 2022-06-22 16:46:24.000000000 +0000 -+++ b/lib/asan/CMakeLists.txt -@@ -46,7 +46,7 @@ set(ASAN_STATIC_SOURCES - asan_rtl_static.cpp - ) - --if (NOT WIN32 AND NOT APPLE) -+if (LINUX) - list(APPEND ASAN_STATIC_SOURCES - asan_rtl_x86_64.S - ) diff --git a/pkgs/development/compilers/llvm/16/compiler-rt/freebsd-i386.patch b/pkgs/development/compilers/llvm/16/compiler-rt/freebsd-i386.patch deleted file mode 100644 index 0a221750552a..000000000000 --- a/pkgs/development/compilers/llvm/16/compiler-rt/freebsd-i386.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/lib/builtins/fp_lib.h 1969-12-31 16:00:01.000000000 -0800 -+++ b/lib/builtins/fp_lib.h 2023-12-21 23:39:36.066927293 -0800 -@@ -26,18 +26,6 @@ - #include - #include - --// x86_64 FreeBSD prior v9.3 define fixed-width types incorrectly in --// 32-bit mode. --#if defined(__FreeBSD__) && defined(__i386__) --#include --#if __FreeBSD_version < 903000 // v9.3 --#define uint64_t unsigned long long --#define int64_t long long --#undef UINT64_C --#define UINT64_C(c) (c##ULL) --#endif --#endif -- - #if defined SINGLE_PRECISION - - typedef uint16_t half_rep_t; diff --git a/pkgs/development/compilers/llvm/16/lld/add-table-base.patch b/pkgs/development/compilers/llvm/16/lld/add-table-base.patch deleted file mode 100644 index 15fc903a5e3f..000000000000 --- a/pkgs/development/compilers/llvm/16/lld/add-table-base.patch +++ /dev/null @@ -1,190 +0,0 @@ -From 93adcb770b99351b18553089c164fe3ef2119699 Mon Sep 17 00:00:00 2001 -From: Sam Clegg -Date: Fri, 25 Aug 2023 13:56:16 -0700 -Subject: [PATCH] [lld][WebAssembly] Add `--table-base` setting - -This is similar to `--global-base` but determines where to place the -table segments rather than that data segments. - -See https://github.com/emscripten-core/emscripten/issues/20097 - -Differential Revision: https://reviews.llvm.org/D158892 ---- - test/wasm/table-base.s | 72 ++++++++++++++++++++++++++++++++++++++ - wasm/Driver.cpp | 19 ++++++++-- - wasm/Options.td | 5 ++- - wasm/Writer.cpp | 8 ----- - 4 files changed, 93 insertions(+), 11 deletions(-) - create mode 100644 test/wasm/table-base.s - -diff --git a/test/wasm/table-base.s b/test/wasm/table-base.s -new file mode 100644 -index 000000000000000..56fff414fd31d96 ---- /dev/null -+++ b/test/wasm/table-base.s -@@ -0,0 +1,72 @@ -+# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t.o -+ -+# RUN: wasm-ld --export=__table_base -o %t.wasm %t.o -+# RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=CHECK-DEFAULT -+ -+# RUN: wasm-ld --table-base=100 --export=__table_base -o %t.wasm %t.o -+# RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=CHECK-100 -+ -+.globl _start -+_start: -+ .functype _start () -> () -+ i32.const _start -+ drop -+ end_function -+ -+# CHECK-DEFAULT: - Type: TABLE -+# CHECK-DEFAULT-NEXT: Tables: -+# CHECK-DEFAULT-NEXT: - Index: 0 -+# CHECK-DEFAULT-NEXT: ElemType: FUNCREF -+# CHECK-DEFAULT-NEXT: Limits: -+# CHECK-DEFAULT-NEXT: Flags: [ HAS_MAX ] -+# CHECK-DEFAULT-NEXT: Minimum: 0x2 -+# CHECK-DEFAULT-NEXT: Maximum: 0x2 -+ -+# CHECK-DEFAULT: - Type: GLOBAL -+# CHECK-DEFAULT-NEXT: Globals: -+# CHECK-DEFAULT-NEXT: - Index: 0 -+# CHECK-DEFAULT-NEXT: Type: I32 -+# CHECK-DEFAULT-NEXT: Mutable: true -+# CHECK-DEFAULT-NEXT: InitExpr: -+# CHECK-DEFAULT-NEXT: Opcode: I32_CONST -+# CHECK-DEFAULT-NEXT: Value: 66560 -+# CHECK-DEFAULT-NEXT: - Index: 1 -+# CHECK-DEFAULT-NEXT: Type: I32 -+# CHECK-DEFAULT-NEXT: Mutable: false -+# CHECK-DEFAULT-NEXT: InitExpr: -+# CHECK-DEFAULT-NEXT: Opcode: I32_CONST -+# CHECK-DEFAULT-NEXT: Value: 1 -+ -+# CHECK-DEFAULT: - Type: EXPORT -+# CHECK-DEFAULT: - Name: __table_base -+# CHECK-DEFAULT-NEXT: Kind: GLOBAL -+# CHECK-DEFAULT-NEXT: Index: 1 -+ -+# CHECK-100: - Type: TABLE -+# CHECK-100-NEXT: Tables: -+# CHECK-100-NEXT: - Index: 0 -+# CHECK-100-NEXT: ElemType: FUNCREF -+# CHECK-100-NEXT: Limits: -+# CHECK-100-NEXT: Flags: [ HAS_MAX ] -+# CHECK-100-NEXT: Minimum: 0x65 -+# CHECK-100-NEXT: Maximum: 0x65 -+ -+# CHECK-100: - Type: GLOBAL -+# CHECK-100-NEXT: Globals: -+# CHECK-100-NEXT: - Index: 0 -+# CHECK-100-NEXT: Type: I32 -+# CHECK-100-NEXT: Mutable: true -+# CHECK-100-NEXT: InitExpr: -+# CHECK-100-NEXT: Opcode: I32_CONST -+# CHECK-100-NEXT: Value: 66560 -+# CHECK-100-NEXT: - Index: 1 -+# CHECK-100-NEXT: Type: I32 -+# CHECK-100-NEXT: Mutable: false -+# CHECK-100-NEXT: InitExpr: -+# CHECK-100-NEXT: Opcode: I32_CONST -+# CHECK-100-NEXT: Value: 100 -+ -+# CHECK-100: - Type: EXPORT -+# CHECK-100: - Name: __table_base -+# CHECK-100-NEXT: Kind: GLOBAL -+# CHECK-100-NEXT: Index: 1 -diff --git a/wasm/Driver.cpp b/wasm/Driver.cpp -index 84304881f5ca34e..c2f5f0185781f36 100644 ---- a/wasm/Driver.cpp -+++ b/wasm/Driver.cpp -@@ -502,6 +502,7 @@ static void readConfigs(opt::InputArgList &args) { - - config->initialMemory = args::getInteger(args, OPT_initial_memory, 0); - config->globalBase = args::getInteger(args, OPT_global_base, 0); -+ config->tableBase = args::getInteger(args, OPT_table_base, 0); - config->maxMemory = args::getInteger(args, OPT_max_memory, 0); - config->zStackSize = - args::getZOptionValue(args, OPT_z, "stack-size", WasmPageSize); -@@ -573,6 +574,17 @@ static void setConfigs() { - if (config->exportTable) - error("-shared/-pie is incompatible with --export-table"); - config->importTable = true; -+ } else { -+ // Default table base. Defaults to 1, reserving 0 for the NULL function -+ // pointer. -+ if (!config->tableBase) -+ config->tableBase = 1; -+ // The default offset for static/global data, for when --global-base is -+ // not specified on the command line. The precise value of 1024 is -+ // somewhat arbitrary, and pre-dates wasm-ld (Its the value that -+ // emscripten used prior to wasm-ld). -+ if (!config->globalBase && !config->relocatable && !config->stackFirst) -+ config->globalBase = 1024; - } - - if (config->relocatable) { -@@ -666,8 +678,11 @@ static void checkOptions(opt::InputArgList &args) { - warn("-Bsymbolic is only meaningful when combined with -shared"); - } - -- if (config->globalBase && config->isPic) { -- error("--global-base may not be used with -shared/-pie"); -+ if (config->isPic) { -+ if (config->globalBase) -+ error("--global-base may not be used with -shared/-pie"); -+ if (config->tableBase) -+ error("--table-base may not be used with -shared/-pie"); - } - } - -diff --git a/wasm/Options.td b/wasm/Options.td -index 50417d2928e0a34..bb764396bf4df14 100644 ---- a/wasm/Options.td -+++ b/wasm/Options.td -@@ -191,7 +191,7 @@ def growable_table: FF<"growable-table">, - HelpText<"Remove maximum size from function table, allowing table to grow">; - - def global_base: JJ<"global-base=">, -- HelpText<"Where to start to place global data">; -+ HelpText<"Memory offset at which to place global data (Defaults to 1024)">; - - def import_memory: FF<"import-memory">, - HelpText<"Import the module's memory from the default module of \"env\" with the name \"memory\".">; -@@ -224,6 +224,9 @@ def no_entry: FF<"no-entry">, - def stack_first: FF<"stack-first">, - HelpText<"Place stack at start of linear memory rather than after data">; - -+def table_base: JJ<"table-base=">, -+ HelpText<"Table offset at which to place address taken functions (Defaults to 1)">; -+ - defm whole_archive: B<"whole-archive", - "Force load of all members in a static library", - "Do not force load of all members in a static library (default)">; -diff --git a/wasm/Writer.cpp b/wasm/Writer.cpp -index f25d358dc5bae6f..0576bf2907e49c4 100644 ---- a/wasm/Writer.cpp -+++ b/wasm/Writer.cpp -@@ -358,13 +358,6 @@ void Writer::layoutMemory() { - memoryPtr = config->globalBase; - } - } else { -- if (!config->globalBase && !config->relocatable && !config->isPic) { -- // The default offset for static/global data, for when --global-base is -- // not specified on the command line. The precise value of 1024 is -- // somewhat arbitrary, and pre-dates wasm-ld (Its the value that -- // emscripten used prior to wasm-ld). -- config->globalBase = 1024; -- } - memoryPtr = config->globalBase; - } - -@@ -1685,7 +1678,6 @@ void Writer::run() { - // For PIC code the table base is assigned dynamically by the loader. - // For non-PIC, we start at 1 so that accessing table index 0 always traps. - if (!config->isPic) { -- config->tableBase = 1; - if (WasmSym::definedTableBase) - WasmSym::definedTableBase->setVA(config->tableBase); - if (WasmSym::definedTableBase32) diff --git a/pkgs/development/compilers/llvm/16/lld/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/16/lld/gnu-install-dirs.patch deleted file mode 100644 index 86e76f4a16d8..000000000000 --- a/pkgs/development/compilers/llvm/16/lld/gnu-install-dirs.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3d6225646fe6..9b5d0b15af13 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -33,10 +33,22 @@ if(LLD_BUILT_STANDALONE) - find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}") - list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}") - -- # Turn into CACHE PATHs for overwriting -- set(LLVM_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed") -- set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}" CACHE PATH "Path to LLVM build tree") -- set(LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm" CACHE PATH "Path to LLVM source tree") -+ # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets -+ # LLVM_CONFIG. -+ if (NOT LLVM_CONFIG_FOUND) -+ # Pull values from LLVMConfig.cmake. We can drop this once the llvm-config -+ # path is removed. -+ set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS}) -+ set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}") -+ # N.B. this is just a default value, the CACHE PATHs below can be overridden. -+ set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm") -+ else() -+ set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}") -+ endif() -+ -+ set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed") -+ set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree") -+ set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree") - - find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR} - NO_DEFAULT_PATH) -diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake -index d3924f7243d4..42a7cd62281c 100644 ---- a/cmake/modules/AddLLD.cmake -+++ b/cmake/modules/AddLLD.cmake -@@ -18,8 +18,8 @@ macro(add_lld_library name) - install(TARGETS ${name} - COMPONENT ${name} - ${export_to_lldtargets} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} -+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" -+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - - if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) diff --git a/pkgs/development/compilers/llvm/16/lldb/resource-dir.patch b/pkgs/development/compilers/llvm/16/lldb/resource-dir.patch deleted file mode 100644 index 3e1a8b7d7142..000000000000 --- a/pkgs/development/compilers/llvm/16/lldb/resource-dir.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake -index ec06ba285f27..286162f098fb 100644 ---- a/cmake/modules/LLDBConfig.cmake -+++ b/cmake/modules/LLDBConfig.cmake -@@ -290,7 +290,8 @@ if (NOT TARGET clang-resource-headers) - # could be and pick the first that exists. - foreach(CANDIDATE "${Clang_DIR}/../.." "${LLVM_DIR}" "${LLVM_LIBRARY_DIRS}" - "${LLVM_BUILD_LIBRARY_DIR}" -- "${LLVM_LIBRARY_DIR}") -+ "${LLVM_LIBRARY_DIR}" -+ "@clangLibDir@") - # Build the resource directory path by appending 'clang/'. - set(CANDIDATE_RESOURCE_DIR "${CANDIDATE}/clang/${LLDB_CLANG_RESOURCE_DIR_NAME}") - if (IS_DIRECTORY "${CANDIDATE_RESOURCE_DIR}") diff --git a/pkgs/development/compilers/llvm/16/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/16/llvm/gnu-install-dirs.patch deleted file mode 100644 index 1c2d52d59ef2..000000000000 --- a/pkgs/development/compilers/llvm/16/llvm/gnu-install-dirs.patch +++ /dev/null @@ -1,161 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7e25e0407db2..72f031a82b75 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -995,7 +995,7 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "") - add_subdirectory(${TENSORFLOW_AOT_PATH}/xla_aot_runtime_src - ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime) - install(TARGETS tf_xla_runtime EXPORT LLVMExports -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime) -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime) - set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS tf_xla_runtime) - # Once we add more modules, we should handle this more automatically. - if (DEFINED LLVM_OVERRIDE_MODEL_HEADER_INLINERSIZEMODEL) -diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake -index 93e6d67551de..8d367457af5a 100644 ---- a/cmake/modules/AddLLVM.cmake -+++ b/cmake/modules/AddLLVM.cmake -@@ -874,8 +874,8 @@ macro(add_llvm_library name) - get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella}) - install(TARGETS ${name} - ${export_to_llvmexports} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name} -+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name} - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name}) - - if (NOT LLVM_ENABLE_IDE) -@@ -2043,7 +2043,7 @@ function(llvm_install_library_symlink name dest type) - set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) - set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) - -- set(output_dir lib${LLVM_LIBDIR_SUFFIX}) -+ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) - if(WIN32 AND "${type}" STREQUAL "SHARED") - set(output_dir "${CMAKE_INSTALL_BINDIR}") - endif() -@@ -2312,16 +2312,37 @@ function(llvm_setup_rpath name) - - if (APPLE) - set(_install_name_dir INSTALL_NAME_DIR "@rpath") -- set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -+ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) - elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX" AND BUILD_SHARED_LIBS) - # $ORIGIN is not interpreted at link time by aix ld. - # Since BUILD_SHARED_LIBS is only recommended for use by developers, - # hardcode the rpath to build/install lib dir first in this mode. - # FIXME: update this when there is better solution. -- set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -+ set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) - elseif(UNIX) -- set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}") -+ # Note that we add `extra_libdir` (aka `LLVM_LIBRARY_DIR` in our case) back -+ # to `_install_rpath` here. -+ # -+ # In nixpkgs we do not build and install LLVM alongside rdeps of LLVM (i.e. -+ # clang); instead LLVM is its own package and thus lands at its own nix -+ # store path. This makes it so that the default relative rpath (`../lib/`) -+ # does not point at the LLVM shared objects. -+ # -+ # More discussion here: -+ # - https://github.com/NixOS/nixpkgs/pull/235624#discussion_r1220150329 -+ # - https://reviews.llvm.org/D146918 (16.0.5+) -+ # -+ # Note that we leave `extra_libdir` in `_build_rpath`: without FHS there is -+ # no potential that this will result in us pulling in the "wrong" LLVM. -+ # Adding this to the build rpath means we aren't forced to use -+ # `installCheckPhase` instead of `checkPhase` (i.e. binaries in the build -+ # dir, pre-install, will have the right rpath for LLVM). -+ # -+ # As noted in the differential above, an alternative solution is to have -+ # all rdeps of nixpkgs' LLVM (that use the AddLLVM.cmake machinery) set -+ # `CMAKE_INSTALL_RPATH`. -+ set(_build_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -+ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) - if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") - set_property(TARGET ${name} APPEND_STRING PROPERTY - LINK_FLAGS " -Wl,-z,origin ") -diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake -index 891c9e6d618c..8d963f3b0069 100644 ---- a/cmake/modules/AddOCaml.cmake -+++ b/cmake/modules/AddOCaml.cmake -@@ -147,9 +147,9 @@ function(add_ocaml_library name) - endforeach() - - if( APPLE ) -- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") -+ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") - elseif( UNIX ) -- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") -+ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") - endif() - list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") - -diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt -index d99af79aa38e..21e794224b99 100644 ---- a/cmake/modules/CMakeLists.txt -+++ b/cmake/modules/CMakeLists.txt -@@ -127,7 +127,7 @@ set(LLVM_CONFIG_INCLUDE_DIRS - ) - list(REMOVE_DUPLICATES LLVM_CONFIG_INCLUDE_DIRS) - --extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "lib\${LLVM_LIBDIR_SUFFIX}") -+extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") - set(LLVM_CONFIG_LIBRARY_DIRS - "${LLVM_CONFIG_LIBRARY_DIR}" - # FIXME: Should there be other entries here? -diff --git a/docs/CMake.rst b/docs/CMake.rst -index 7926de258ec8..5ae01adc3905 100644 ---- a/docs/CMake.rst -+++ b/docs/CMake.rst -@@ -250,7 +250,7 @@ description is in `LLVM-related variables`_ below. - **LLVM_LIBDIR_SUFFIX**:STRING - Extra suffix to append to the directory where libraries are to be - installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` -- to install libraries to ``/usr/lib64``. -+ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. - - **LLVM_PARALLEL_{COMPILE,LINK}_JOBS**:STRING - Building the llvm toolchain can use a lot of resources, particularly -@@ -284,6 +284,10 @@ manual, or execute ``cmake --help-variable VARIABLE_NAME``. - The path to install executables, relative to the *CMAKE_INSTALL_PREFIX*. - Defaults to "bin". - -+**CMAKE_INSTALL_LIBDIR**:PATH -+ The path to install libraries, relative to the *CMAKE_INSTALL_PREFIX*. -+ Defaults to "lib". -+ - **CMAKE_INSTALL_INCLUDEDIR**:PATH - The path to install header files, relative to the *CMAKE_INSTALL_PREFIX*. - Defaults to "include". -diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in -index 370005cd8d7d..7e790bc52111 100644 ---- a/tools/llvm-config/BuildVariables.inc.in -+++ b/tools/llvm-config/BuildVariables.inc.in -@@ -23,6 +23,7 @@ - #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" - #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" - #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" -+#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" - #define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" - #define LLVM_INSTALL_PACKAGE_DIR "@LLVM_INSTALL_PACKAGE_DIR@" - #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" -diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp -index b1d795a0a349..de6cb1514f05 100644 ---- a/tools/llvm-config/llvm-config.cpp -+++ b/tools/llvm-config/llvm-config.cpp -@@ -366,7 +366,11 @@ int main(int argc, char **argv) { - sys::fs::make_absolute(ActivePrefix, Path); - ActiveBinDir = std::string(Path.str()); - } -- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; -+ { -+ SmallString<256> Path(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX); -+ sys::fs::make_absolute(ActivePrefix, Path); -+ ActiveLibDir = std::string(Path.str()); -+ } - { - SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR); - sys::fs::make_absolute(ActivePrefix, Path); diff --git a/pkgs/development/compilers/llvm/16/llvm/lit-shell-script-runner-set-dyld-library-path.patch b/pkgs/development/compilers/llvm/16/llvm/lit-shell-script-runner-set-dyld-library-path.patch deleted file mode 100644 index 82b7b21c55fb..000000000000 --- a/pkgs/development/compilers/llvm/16/llvm/lit-shell-script-runner-set-dyld-library-path.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py -index 0242e0b75af3..d732011306f7 100644 ---- a/utils/lit/lit/TestRunner.py -+++ b/utils/lit/lit/TestRunner.py -@@ -1029,6 +1029,12 @@ def executeScript(test, litConfig, tmpBase, commands, cwd): - f.write('@echo off\n') - f.write('\n@if %ERRORLEVEL% NEQ 0 EXIT\n'.join(commands)) - else: -+ # This env var is *purged* when invoking subprocesses so we have to -+ # manually set it from within the bash script in order for the commands -+ # in run lines to see this var: -+ if "DYLD_LIBRARY_PATH" in test.config.environment: -+ f.write(f'export DYLD_LIBRARY_PATH="{test.config.environment["DYLD_LIBRARY_PATH"]}"\n') -+ - for i, ln in enumerate(commands): - match = re.match(kPdbgRegex, ln) - if match: diff --git a/pkgs/development/compilers/llvm/16/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch b/pkgs/development/compilers/llvm/16/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch deleted file mode 100644 index d824516c0a16..000000000000 --- a/pkgs/development/compilers/llvm/16/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch +++ /dev/null @@ -1,79 +0,0 @@ -diff --git a/test/Unit/lit.cfg.py b/test/Unit/lit.cfg.py -index 81e8dc04acea..479ff95681e2 100644 ---- a/test/Unit/lit.cfg.py -+++ b/test/Unit/lit.cfg.py -@@ -3,6 +3,7 @@ - # Configuration file for the 'lit' test runner. - - import os -+import platform - import subprocess - - import lit.formats -@@ -55,3 +56,26 @@ if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir): - # Win32 may use %SYSTEMDRIVE% during file system shell operations, so propogate. - if sys.platform == 'win32' and 'SYSTEMDRIVE' in os.environ: - config.environment['SYSTEMDRIVE'] = os.environ['SYSTEMDRIVE'] -+ -+# Add the LLVM dynamic libs to the platform-specific loader search path env var: -+# -+# TODO: this is copied from `clang`'s `lit.cfg.py`; should unify.. -+def find_shlibpath_var(): -+ if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'OpenBSD', 'SunOS']: -+ yield 'LD_LIBRARY_PATH' -+ elif platform.system() == 'Darwin': -+ yield 'DYLD_LIBRARY_PATH' -+ elif platform.system() == 'Windows': -+ yield 'PATH' -+ elif platform.system() == 'AIX': -+ yield 'LIBPATH' -+ -+for shlibpath_var in find_shlibpath_var(): -+ shlibpath = os.path.pathsep.join( -+ (config.shlibdir, -+ config.environment.get(shlibpath_var, ''))) -+ config.environment[shlibpath_var] = shlibpath -+ break -+else: -+ lit_config.warning("unable to inject shared library path on '{}'" -+ .format(platform.system())) -diff --git a/test/lit.cfg.py b/test/lit.cfg.py -index 75a38b4c5dad..856fc75c9d74 100644 ---- a/test/lit.cfg.py -+++ b/test/lit.cfg.py -@@ -42,6 +42,26 @@ llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True) - llvm_config.with_system_environment( - ['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP']) - -+# Add the LLVM dynamic libs to the platform-specific loader search path env var: -+# -+# TODO: this is copied from `clang`'s `lit.cfg.py`; should unify.. -+def find_shlibpath_var(): -+ if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'OpenBSD', 'SunOS']: -+ yield 'LD_LIBRARY_PATH' -+ elif platform.system() == 'Darwin': -+ yield 'DYLD_LIBRARY_PATH' -+ elif platform.system() == 'Windows': -+ yield 'PATH' -+ elif platform.system() == 'AIX': -+ yield 'LIBPATH' -+ -+for shlibpath_var in find_shlibpath_var(): -+ shlibpath = config.llvm_shlib_dir -+ llvm_config.with_environment(shlibpath_var, shlibpath, append_path = True) -+ break -+else: -+ lit_config.warning("unable to inject shared library path on '{}'" -+ .format(platform.system())) - - # Set up OCAMLPATH to include newly built OCaml libraries. - top_ocaml_lib = os.path.join(config.llvm_lib_dir, 'ocaml') -@@ -318,7 +338,7 @@ def have_cxx_shared_library(): - - try: - readobj_cmd = subprocess.Popen( -- [readobj_exe, '--needed-libs', readobj_exe], stdout=subprocess.PIPE) -+ [readobj_exe, '--needed-libs', readobj_exe], stdout=subprocess.PIPE, env=config.environment) - except OSError: - print('could not exec llvm-readobj') - return False diff --git a/pkgs/development/compilers/llvm/16/openmp/fix-find-tool.patch b/pkgs/development/compilers/llvm/16/openmp/fix-find-tool.patch deleted file mode 100644 index dd0a79f1d325..000000000000 --- a/pkgs/development/compilers/llvm/16/openmp/fix-find-tool.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/libomptarget/DeviceRTL/CMakeLists.txt b/libomptarget/DeviceRTL/CMakeLists.txt -index 49b398c9f765..6f1dd1340010 100644 ---- a/libomptarget/DeviceRTL/CMakeLists.txt -+++ b/libomptarget/DeviceRTL/CMakeLists.txt -@@ -27,11 +27,11 @@ endif() - if (LLVM_DIR) - # Builds that use pre-installed LLVM have LLVM_DIR set. - # A standalone or LLVM_ENABLE_RUNTIMES=openmp build takes this route -- find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) -- find_program(PACKAGER_TOOL clang-offload-packager PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) -- find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) -- find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) -- find_program(EXTRACT_TOOL llvm-extract PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) -+ find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR}) -+ find_program(PACKAGER_TOOL clang-offload-packager PATHS ${LLVM_TOOLS_BINARY_DIR}) -+ find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR}) -+ find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR}) -+ find_program(EXTRACT_TOOL llvm-extract PATHS ${LLVM_TOOLS_BINARY_DIR}) - if ((NOT CLANG_TOOL) OR (NOT LINK_TOOL) OR (NOT OPT_TOOL) OR (NOT EXTRACT_TOOL) OR (NOT PACKAGER_TOOL)) - libomptarget_say("Not building DeviceRTL. Missing clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL}, opt: ${OPT_TOOL}, llvm-extract: ${EXTRACT_TOOL}, or clang-offload-packager: ${PACKAGER_TOOL}") - return() diff --git a/pkgs/development/compilers/llvm/16/openmp/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/16/openmp/gnu-install-dirs.patch deleted file mode 100644 index 77a93208832a..000000000000 --- a/pkgs/development/compilers/llvm/16/openmp/gnu-install-dirs.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b6ddbe90516d..311ab1d50e7f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -29,7 +29,7 @@ if (OPENMP_STANDALONE_BUILD) - set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING - "Suffix of lib installation directory, e.g. 64 => lib64") - # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. -- set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") -+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}") - - # Group test settings. - set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING -@@ -40,7 +40,7 @@ if (OPENMP_STANDALONE_BUILD) - else() - set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) - # If building in tree, we honor the same install suffix LLVM uses. -- set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}") -+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") - - if (NOT MSVC) - set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang) diff --git a/pkgs/development/compilers/llvm/17/clang/aarch64-tblgen.patch b/pkgs/development/compilers/llvm/17/clang/aarch64-tblgen.patch deleted file mode 100644 index 34957087726e..000000000000 --- a/pkgs/development/compilers/llvm/17/clang/aarch64-tblgen.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/include/clang/Basic/TokenKinds.def b/include/clang/Basic/TokenKinds.def -index ef0dad0f2..afd101b00 100644 ---- a/include/clang/Basic/TokenKinds.def -+++ b/include/clang/Basic/TokenKinds.def -@@ -753,7 +753,7 @@ KEYWORD(__builtin_sycl_unique_stable_name, KEYSYCL) - - // Keywords defined by Attr.td. - #ifndef KEYWORD_ATTRIBUTE --#define KEYWORD_ATTRIBUTE(X) KEYWORD(X, KEYALL) -+#define KEYWORD_ATTRIBUTE(X, EMPTY) KEYWORD(EMPTY ## X, KEYALL) - #endif - #include "clang/Basic/AttrTokenKinds.inc" - -diff --git a/include/clang/Basic/TokenKinds.h b/include/clang/Basic/TokenKinds.h -index e4857405b..ff117bd5a 100644 ---- a/include/clang/Basic/TokenKinds.h -+++ b/include/clang/Basic/TokenKinds.h -@@ -109,7 +109,7 @@ bool isPragmaAnnotation(TokenKind K); - - inline constexpr bool isRegularKeywordAttribute(TokenKind K) { - return (false --#define KEYWORD_ATTRIBUTE(X) || (K == tok::kw_##X) -+#define KEYWORD_ATTRIBUTE(X, ...) || (K == tok::kw_##X) - #include "clang/Basic/AttrTokenKinds.inc" - ); - } -diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp -index b5813c6ab..79db17501 100644 ---- a/utils/TableGen/ClangAttrEmitter.cpp -+++ b/utils/TableGen/ClangAttrEmitter.cpp -@@ -3430,7 +3430,7 @@ void EmitClangAttrTokenKinds(RecordKeeper &Records, raw_ostream &OS) { - "RegularKeyword attributes with arguments are not " - "yet supported"); - OS << "KEYWORD_ATTRIBUTE(" -- << S.getSpellingRecord().getValueAsString("Name") << ")\n"; -+ << S.getSpellingRecord().getValueAsString("Name") << ", )\n"; - } - OS << "#undef KEYWORD_ATTRIBUTE\n"; - } diff --git a/pkgs/development/compilers/llvm/17/clang/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/17/clang/gnu-install-dirs.patch deleted file mode 100644 index cc8737f35343..000000000000 --- a/pkgs/development/compilers/llvm/17/clang/gnu-install-dirs.patch +++ /dev/null @@ -1,98 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f7936d72e088..a362fa49b534 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -31,7 +31,21 @@ if(CLANG_BUILT_STANDALONE) - find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}") - list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}") - -- # Turn into CACHE PATHs for overwritting -+ # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets -+ # LLVM_CONFIG. -+ if (NOT LLVM_CONFIG_FOUND) -+ # Pull values from LLVMConfig.cmake. We can drop this once the llvm-config -+ # path is removed. -+ set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS}) -+ set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}") -+ # N.B. this is just a default value, the CACHE PATHs below can be overriden. -+ set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm") -+ set(TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}") -+ set(LIBRARY_DIR "${LLVM_LIBRARY_DIR}") -+ else() -+ set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}") -+ endif() -+ - set(LLVM_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed") - set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}" CACHE PATH "Path to LLVM build tree") - set(LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm" CACHE PATH "Path to LLVM source tree") -diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake -index 75b0080f6715..c895b884cd27 100644 ---- a/cmake/modules/AddClang.cmake -+++ b/cmake/modules/AddClang.cmake -@@ -119,8 +119,8 @@ macro(add_clang_library name) - install(TARGETS ${lib} - COMPONENT ${lib} - ${export_to_clangtargets} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} -+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" -+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - - if (NOT LLVM_ENABLE_IDE) -diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt -index f2b0c5cddcbb..52f37fc368ce 100644 ---- a/lib/Headers/CMakeLists.txt -+++ b/lib/Headers/CMakeLists.txt -@@ -473,6 +473,7 @@ add_header_target("windows-resource-headers" ${windows_only_files}) - add_header_target("utility-resource-headers" ${utility_files}) - - get_clang_resource_dir(header_install_dir SUBDIR include) -+set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${CLANG_VERSION_MAJOR}/include) - - ############################################################# - # Install rules for the catch-all clang-resource-headers target -diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt -index 4f23065a2472..6a0f55991e24 100644 ---- a/tools/libclang/CMakeLists.txt -+++ b/tools/libclang/CMakeLists.txt -@@ -234,7 +234,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS}) - COMPONENT - libclang-python-bindings - DESTINATION -- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") -+ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") - endforeach() - if(NOT LLVM_ENABLE_IDE) - add_custom_target(libclang-python-bindings) -diff --git a/tools/scan-build-py/CMakeLists.txt b/tools/scan-build-py/CMakeLists.txt -index 3aca22c0b0a8..3115353e3fe3 100644 ---- a/tools/scan-build-py/CMakeLists.txt -+++ b/tools/scan-build-py/CMakeLists.txt -@@ -88,7 +88,7 @@ foreach(lib ${LibScanbuild}) - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib}) - list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib}) - install(FILES lib/libscanbuild/${lib} -- DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libscanbuild -+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild" - COMPONENT scan-build-py) - endforeach() - -@@ -106,7 +106,7 @@ foreach(resource ${LibScanbuildResources}) - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource}) - list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource}) - install(FILES lib/libscanbuild/resources/${resource} -- DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libscanbuild/resources -+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild/resources" - COMPONENT scan-build-py) - endforeach() - -@@ -122,7 +122,7 @@ foreach(lib ${LibEar}) - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib}) - list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib}) - install(FILES lib/libear/${lib} -- DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libear -+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libear" - COMPONENT scan-build-py) - endforeach() - diff --git a/pkgs/development/compilers/llvm/17/clang/purity.patch b/pkgs/development/compilers/llvm/17/clang/purity.patch deleted file mode 100644 index 1c94f293eb93..000000000000 --- a/pkgs/development/compilers/llvm/17/clang/purity.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 4add81bba40dcec62c4ea4481be8e35ac53e89d8 Mon Sep 17 00:00:00 2001 -From: Will Dietz -Date: Thu, 18 May 2017 11:56:12 -0500 -Subject: [PATCH] "purity" patch for 5.0 - ---- - lib/Driver/ToolChains/Gnu.cpp | 7 ------- - 1 file changed, 7 deletions(-) - -diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp -index fe3c0191bb..c6a482bece 100644 ---- a/lib/Driver/ToolChains/Gnu.cpp -+++ b/lib/Driver/ToolChains/Gnu.cpp -@@ -487,13 +487,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, - } else { - if (Args.hasArg(options::OPT_rdynamic)) - CmdArgs.push_back("-export-dynamic"); - -- if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE && -- !Args.hasArg(options::OPT_r)) { -- CmdArgs.push_back("-dynamic-linker"); -- CmdArgs.push_back(Args.MakeArgString(Twine(D.DyldPrefix) + -- ToolChain.getDynamicLinker(Args))); -- } - } - - CmdArgs.push_back("-o"); --- -2.11.0 diff --git a/pkgs/development/compilers/llvm/17/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/17/compiler-rt/gnu-install-dirs.patch deleted file mode 100644 index f3b1f63a7d71..000000000000 --- a/pkgs/development/compilers/llvm/17/compiler-rt/gnu-install-dirs.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake -index 8a6219568b3f..30ee68a47ccf 100644 ---- a/cmake/base-config-ix.cmake -+++ b/cmake/base-config-ix.cmake -@@ -100,13 +100,13 @@ endif() - if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) - set(COMPILER_RT_OUTPUT_LIBRARY_DIR - ${COMPILER_RT_OUTPUT_DIR}/lib) -- extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" lib) -+ extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}") - set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH - "Path where built compiler-rt libraries should be installed.") - else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) - set(COMPILER_RT_OUTPUT_LIBRARY_DIR - ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) -- extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "lib/${COMPILER_RT_OS_DIR}") -+ extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}/${COMPILER_RT_OS_DIR}") - set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH - "Path where built compiler-rt libraries should be installed.") - endif() diff --git a/pkgs/development/compilers/llvm/17/lld/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/17/lld/gnu-install-dirs.patch deleted file mode 100644 index 86e76f4a16d8..000000000000 --- a/pkgs/development/compilers/llvm/17/lld/gnu-install-dirs.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3d6225646fe6..9b5d0b15af13 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -33,10 +33,22 @@ if(LLD_BUILT_STANDALONE) - find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}") - list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}") - -- # Turn into CACHE PATHs for overwriting -- set(LLVM_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed") -- set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}" CACHE PATH "Path to LLVM build tree") -- set(LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm" CACHE PATH "Path to LLVM source tree") -+ # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets -+ # LLVM_CONFIG. -+ if (NOT LLVM_CONFIG_FOUND) -+ # Pull values from LLVMConfig.cmake. We can drop this once the llvm-config -+ # path is removed. -+ set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS}) -+ set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}") -+ # N.B. this is just a default value, the CACHE PATHs below can be overridden. -+ set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm") -+ else() -+ set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}") -+ endif() -+ -+ set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed") -+ set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree") -+ set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree") - - find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR} - NO_DEFAULT_PATH) -diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake -index d3924f7243d4..42a7cd62281c 100644 ---- a/cmake/modules/AddLLD.cmake -+++ b/cmake/modules/AddLLD.cmake -@@ -18,8 +18,8 @@ macro(add_lld_library name) - install(TARGETS ${name} - COMPONENT ${name} - ${export_to_lldtargets} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} -+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" -+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - - if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) diff --git a/pkgs/development/compilers/llvm/17/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/17/llvm/gnu-install-dirs.patch deleted file mode 100644 index eb9f6098d1c9..000000000000 --- a/pkgs/development/compilers/llvm/17/llvm/gnu-install-dirs.patch +++ /dev/null @@ -1,137 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 471817d68286..c51463304159 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1010,7 +1010,7 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "") - add_subdirectory(${TENSORFLOW_AOT_PATH}/xla_aot_runtime_src - ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime) - install(TARGETS tf_xla_runtime EXPORT LLVMExports -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime) -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime) - set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS tf_xla_runtime) - # Once we add more modules, we should handle this more automatically. - if (DEFINED LLVM_OVERRIDE_MODEL_HEADER_INLINERSIZEMODEL) -diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake -index 230620c37027..dd16cab1835e 100644 ---- a/cmake/modules/AddLLVM.cmake -+++ b/cmake/modules/AddLLVM.cmake -@@ -876,8 +876,8 @@ macro(add_llvm_library name) - get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella}) - install(TARGETS ${name} - ${export_to_llvmexports} -- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} -+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name} -+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name} - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name}) - - if (NOT LLVM_ENABLE_IDE) -@@ -2069,7 +2069,7 @@ function(llvm_install_library_symlink name dest type) - set(LLVM_LINK_OR_COPY copy) - endif() - -- set(output_dir lib${LLVM_LIBDIR_SUFFIX}) -+ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) - if(WIN32 AND "${type}" STREQUAL "SHARED") - set(output_dir "${CMAKE_INSTALL_BINDIR}") - endif() -@@ -2344,16 +2344,37 @@ function(llvm_setup_rpath name) - - if (APPLE) - set(_install_name_dir INSTALL_NAME_DIR "@rpath") -- set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -+ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) - elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX" AND BUILD_SHARED_LIBS) - # $ORIGIN is not interpreted at link time by aix ld. - # Since BUILD_SHARED_LIBS is only recommended for use by developers, - # hardcode the rpath to build/install lib dir first in this mode. - # FIXME: update this when there is better solution. -- set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -+ set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) - elseif(UNIX) -- set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}") -+ # Note that we add `extra_libdir` (aka `LLVM_LIBRARY_DIR` in our case) back -+ # to `_install_rpath` here. -+ # -+ # In nixpkgs we do not build and install LLVM alongside rdeps of LLVM (i.e. -+ # clang); instead LLVM is its own package and thus lands at its own nix -+ # store path. This makes it so that the default relative rpath (`../lib/`) -+ # does not point at the LLVM shared objects. -+ # -+ # More discussion here: -+ # - https://github.com/NixOS/nixpkgs/pull/235624#discussion_r1220150329 -+ # - https://reviews.llvm.org/D146918 (16.0.5+) -+ # -+ # Note that we leave `extra_libdir` in `_build_rpath`: without FHS there is -+ # no potential that this will result in us pulling in the "wrong" LLVM. -+ # Adding this to the build rpath means we aren't forced to use -+ # `installCheckPhase` instead of `checkPhase` (i.e. binaries in the build -+ # dir, pre-install, will have the right rpath for LLVM). -+ # -+ # As noted in the differential above, an alternative solution is to have -+ # all rdeps of nixpkgs' LLVM (that use the AddLLVM.cmake machinery) set -+ # `CMAKE_INSTALL_RPATH`. -+ set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) -+ set(_install_rpath ${extra_libdir}) - if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") - set_property(TARGET ${name} APPEND_STRING PROPERTY - LINK_FLAGS " -Wl,-z,origin ") -diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake -index 891c9e6d618c..8d963f3b0069 100644 ---- a/cmake/modules/AddOCaml.cmake -+++ b/cmake/modules/AddOCaml.cmake -@@ -147,9 +147,9 @@ function(add_ocaml_library name) - endforeach() - - if( APPLE ) -- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") -+ set(ocaml_rpath "${LLVM_LIBRARY_DIR}") - elseif( UNIX ) -- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") -+ set(ocaml_rpath "${LLVM_LIBRARY_DIR}") - endif() - list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") - -diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt -index d99af79aa38e..21e794224b99 100644 ---- a/cmake/modules/CMakeLists.txt -+++ b/cmake/modules/CMakeLists.txt -@@ -127,7 +127,7 @@ set(LLVM_CONFIG_INCLUDE_DIRS - ) - list(REMOVE_DUPLICATES LLVM_CONFIG_INCLUDE_DIRS) - --extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "lib\${LLVM_LIBDIR_SUFFIX}") -+extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") - set(LLVM_CONFIG_LIBRARY_DIRS - "${LLVM_CONFIG_LIBRARY_DIR}" - # FIXME: Should there be other entries here? -diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in -index 370005cd8d7d..7e790bc52111 100644 ---- a/tools/llvm-config/BuildVariables.inc.in -+++ b/tools/llvm-config/BuildVariables.inc.in -@@ -23,6 +23,7 @@ - #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" - #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" - #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" -+#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" - #define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" - #define LLVM_INSTALL_PACKAGE_DIR "@LLVM_INSTALL_PACKAGE_DIR@" - #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" -diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp -index e86eb2b44b10..f63e207e792e 100644 ---- a/tools/llvm-config/llvm-config.cpp -+++ b/tools/llvm-config/llvm-config.cpp -@@ -366,7 +366,11 @@ int main(int argc, char **argv) { - sys::fs::make_absolute(ActivePrefix, Path); - ActiveBinDir = std::string(Path.str()); - } -- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; -+ { -+ SmallString<256> Path(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX); -+ sys::fs::make_absolute(ActivePrefix, Path); -+ ActiveLibDir = std::string(Path.str()); -+ } - { - SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR); - sys::fs::make_absolute(ActivePrefix, Path); diff --git a/pkgs/development/compilers/llvm/17/openmp/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/17/openmp/gnu-install-dirs.patch deleted file mode 100644 index 77a93208832a..000000000000 --- a/pkgs/development/compilers/llvm/17/openmp/gnu-install-dirs.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b6ddbe90516d..311ab1d50e7f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -29,7 +29,7 @@ if (OPENMP_STANDALONE_BUILD) - set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING - "Suffix of lib installation directory, e.g. 64 => lib64") - # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. -- set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") -+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}") - - # Group test settings. - set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING -@@ -40,7 +40,7 @@ if (OPENMP_STANDALONE_BUILD) - else() - set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) - # If building in tree, we honor the same install suffix LLVM uses. -- set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}") -+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") - - if (NOT MSVC) - set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang) diff --git a/pkgs/development/compilers/llvm/15/compiler-rt/X86-support-extension.patch b/pkgs/development/compilers/llvm/18/compiler-rt/X86-support-extension.patch similarity index 100% rename from pkgs/development/compilers/llvm/15/compiler-rt/X86-support-extension.patch rename to pkgs/development/compilers/llvm/18/compiler-rt/X86-support-extension.patch diff --git a/pkgs/development/compilers/llvm/15/compiler-rt/armv6-scudo-libatomic.patch b/pkgs/development/compilers/llvm/18/compiler-rt/armv6-scudo-libatomic.patch similarity index 100% rename from pkgs/development/compilers/llvm/15/compiler-rt/armv6-scudo-libatomic.patch rename to pkgs/development/compilers/llvm/18/compiler-rt/armv6-scudo-libatomic.patch diff --git a/pkgs/development/compilers/llvm/16/compiler-rt/normalize-var.patch b/pkgs/development/compilers/llvm/18/compiler-rt/normalize-var.patch similarity index 100% rename from pkgs/development/compilers/llvm/16/compiler-rt/normalize-var.patch rename to pkgs/development/compilers/llvm/18/compiler-rt/normalize-var.patch diff --git a/pkgs/development/compilers/llvm/16/libclc/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/18/libclc/gnu-install-dirs.patch similarity index 100% rename from pkgs/development/compilers/llvm/16/libclc/gnu-install-dirs.patch rename to pkgs/development/compilers/llvm/18/libclc/gnu-install-dirs.patch diff --git a/pkgs/development/compilers/llvm/17/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch b/pkgs/development/compilers/llvm/18/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch similarity index 100% rename from pkgs/development/compilers/llvm/17/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch rename to pkgs/development/compilers/llvm/18/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch diff --git a/pkgs/development/compilers/llvm/15/llvm/polly-lit-cfg-add-libs-to-dylib-path.patch b/pkgs/development/compilers/llvm/18/llvm/polly-lit-cfg-add-libs-to-dylib-path.patch similarity index 100% rename from pkgs/development/compilers/llvm/15/llvm/polly-lit-cfg-add-libs-to-dylib-path.patch rename to pkgs/development/compilers/llvm/18/llvm/polly-lit-cfg-add-libs-to-dylib-path.patch diff --git a/pkgs/development/compilers/llvm/17/openmp/fix-find-tool.patch b/pkgs/development/compilers/llvm/18/openmp/fix-find-tool.patch similarity index 100% rename from pkgs/development/compilers/llvm/17/openmp/fix-find-tool.patch rename to pkgs/development/compilers/llvm/18/openmp/fix-find-tool.patch diff --git a/pkgs/development/compilers/llvm/16/openmp/run-lit-directly.patch b/pkgs/development/compilers/llvm/18/openmp/run-lit-directly.patch similarity index 100% rename from pkgs/development/compilers/llvm/16/openmp/run-lit-directly.patch rename to pkgs/development/compilers/llvm/18/openmp/run-lit-directly.patch diff --git a/pkgs/development/compilers/llvm/common/bintools.nix b/pkgs/development/compilers/llvm/common/bintools.nix index 24af8c618e91..fa3228ecff28 100644 --- a/pkgs/development/compilers/llvm/common/bintools.nix +++ b/pkgs/development/compilers/llvm/common/bintools.nix @@ -22,42 +22,38 @@ runCommand "llvm-binutils-${version}" inherit llvm lld; }; } - ( - '' - mkdir -p $out/bin - for prog in ${lld}/bin/*; do - ln -s $prog $out/bin/${targetPrefix}$(basename $prog) - done - for prog in ${llvm}/bin/*; do - ln -sf $prog $out/bin/${targetPrefix}$(basename $prog) - done + '' + mkdir -p $out/bin + for prog in ${lld}/bin/*; do + ln -s $prog $out/bin/${targetPrefix}$(basename $prog) + done + for prog in ${llvm}/bin/*; do + ln -sf $prog $out/bin/${targetPrefix}$(basename $prog) + done - llvmBin="${llvm}/bin" + llvmBin="${llvm}/bin" - ln -s $llvmBin/llvm-ar $out/bin/${targetPrefix}ar - ln -s $llvmBin/llvm-ar $out/bin/${targetPrefix}dlltool - ln -s $llvmBin/llvm-ar $out/bin/${targetPrefix}ranlib - ln -s $llvmBin/llvm-cxxfilt $out/bin/${targetPrefix}c++filt - ln -s $llvmBin/llvm-dwp $out/bin/${targetPrefix}dwp - ln -s $llvmBin/llvm-nm $out/bin/${targetPrefix}nm - ln -s $llvmBin/llvm-objcopy $out/bin/${targetPrefix}objcopy - ln -s $llvmBin/llvm-objcopy $out/bin/${targetPrefix}strip - ln -s $llvmBin/llvm-objdump $out/bin/${targetPrefix}objdump - ln -s $llvmBin/llvm-readobj $out/bin/${targetPrefix}readelf - ln -s $llvmBin/llvm-size $out/bin/${targetPrefix}size - ln -s $llvmBin/llvm-strings $out/bin/${targetPrefix}strings - ln -s $llvmBin/llvm-symbolizer $out/bin/${targetPrefix}addr2line + ln -s $llvmBin/llvm-ar $out/bin/${targetPrefix}ar + ln -s $llvmBin/llvm-ar $out/bin/${targetPrefix}dlltool + ln -s $llvmBin/llvm-ar $out/bin/${targetPrefix}ranlib + ln -s $llvmBin/llvm-cxxfilt $out/bin/${targetPrefix}c++filt + ln -s $llvmBin/llvm-dwp $out/bin/${targetPrefix}dwp + ln -s $llvmBin/llvm-nm $out/bin/${targetPrefix}nm + ln -s $llvmBin/llvm-objcopy $out/bin/${targetPrefix}objcopy + ln -s $llvmBin/llvm-objcopy $out/bin/${targetPrefix}strip + ln -s $llvmBin/llvm-objdump $out/bin/${targetPrefix}objdump + ln -s $llvmBin/llvm-readobj $out/bin/${targetPrefix}readelf + ln -s $llvmBin/llvm-size $out/bin/${targetPrefix}size + ln -s $llvmBin/llvm-strings $out/bin/${targetPrefix}strings + ln -s $llvmBin/llvm-symbolizer $out/bin/${targetPrefix}addr2line - if [ -e "$llvmBin/llvm-debuginfod" ]; then - ln -s $llvmBin/llvm-debuginfod $out/bin/${targetPrefix}debuginfod - ln -s $llvmBin/llvm-debuginfod-find $out/bin/${targetPrefix}debuginfod-find - fi + if [ -e "$llvmBin/llvm-debuginfod" ]; then + ln -s $llvmBin/llvm-debuginfod $out/bin/${targetPrefix}debuginfod + ln -s $llvmBin/llvm-debuginfod-find $out/bin/${targetPrefix}debuginfod-find + fi - ln -s ${lld}/bin/lld $out/bin/${targetPrefix}ld + ln -s ${lld}/bin/lld $out/bin/${targetPrefix}ld - # Only >=13 show GNU windres compatible in help - '' - + lib.optionalString (lib.versionAtLeast release_version "13") '' - ln -s $llvmBin/llvm-rc $out/bin/${targetPrefix}windres - '' - ) + # Only >=13 show GNU windres compatible in help + ln -s $llvmBin/llvm-rc $out/bin/${targetPrefix}windres + '' diff --git a/pkgs/development/compilers/llvm/common/bolt/default.nix b/pkgs/development/compilers/llvm/common/bolt/default.nix index 9501b79493a7..3172d665adf1 100644 --- a/pkgs/development/compilers/llvm/common/bolt/default.nix +++ b/pkgs/development/compilers/llvm/common/bolt/default.nix @@ -23,22 +23,16 @@ stdenv.mkDerivation (finalAttrs: { inherit version; # Blank llvm dir just so relative path works - src = runCommand "bolt-src-${finalAttrs.version}" { inherit (monorepoSrc) passthru; } ( - '' - mkdir $out - '' - + lib.optionalString (lib.versionAtLeast release_version "14") '' - cp -r ${monorepoSrc}/cmake "$out" - '' - + '' - cp -r ${monorepoSrc}/${finalAttrs.pname} "$out" - cp -r ${monorepoSrc}/third-party "$out" + src = runCommand "bolt-src-${finalAttrs.version}" { inherit (monorepoSrc) passthru; } ('' + mkdir $out + cp -r ${monorepoSrc}/cmake "$out" + cp -r ${monorepoSrc}/${finalAttrs.pname} "$out" + cp -r ${monorepoSrc}/third-party "$out" - # BOLT re-runs tablegen against LLVM sources, so needs them available. - cp -r ${monorepoSrc}/llvm/ "$out" - chmod -R +w $out/llvm - '' - ); + # BOLT re-runs tablegen against LLVM sources, so needs them available. + cp -r ${monorepoSrc}/llvm/ "$out" + chmod -R +w $out/llvm + ''); sourceRoot = "${finalAttrs.src.name}/bolt"; diff --git a/pkgs/development/compilers/llvm/common/clang/clang-11-15-LLVMgold-path.patch b/pkgs/development/compilers/llvm/common/clang/clang-11-15-LLVMgold-path.patch deleted file mode 100644 index 8f8991976f33..000000000000 --- a/pkgs/development/compilers/llvm/common/clang/clang-11-15-LLVMgold-path.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/lib/Driver/ToolChains/CommonArgs.cpp b/lib/Driver/ToolChains/CommonArgs.cpp -index 6b6e276b8ce7..7896542a1202 100644 ---- a/lib/Driver/ToolChains/CommonArgs.cpp -+++ b/lib/Driver/ToolChains/CommonArgs.cpp -@@ -409,7 +409,7 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args, - - SmallString<1024> Plugin; - llvm::sys::path::native( -- Twine(D.Dir) + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold" + Suffix, -+ Twine("@libllvmLibdir@" "/LLVMgold") + Suffix, - Plugin); - CmdArgs.push_back(Args.MakeArgString(Plugin)); - } diff --git a/pkgs/development/compilers/llvm/common/clang/default.nix b/pkgs/development/compilers/llvm/common/clang/default.nix index 90fc14a97712..3cb821a7516b 100644 --- a/pkgs/development/compilers/llvm/common/clang/default.nix +++ b/pkgs/development/compilers/llvm/common/clang/default.nix @@ -28,18 +28,12 @@ stdenv.mkDerivation ( src = if monorepoSrc != null then - runCommand "clang-src-${version}" { inherit (monorepoSrc) passthru; } ( - '' - mkdir -p "$out" - '' - + lib.optionalString (lib.versionAtLeast release_version "14") '' - cp -r ${monorepoSrc}/cmake "$out" - '' - + '' - cp -r ${monorepoSrc}/clang "$out" - cp -r ${monorepoSrc}/clang-tools-extra "$out" - '' - ) + runCommand "clang-src-${version}" { inherit (monorepoSrc) passthru; } ('' + mkdir -p "$out" + cp -r ${monorepoSrc}/cmake "$out" + cp -r ${monorepoSrc}/clang "$out" + cp -r ${monorepoSrc}/clang-tools-extra "$out" + '') else src; @@ -58,61 +52,12 @@ stdenv.mkDerivation ( # libraries. eg: `clang -munsupported hello.c -lc` ./clang-unsupported-option.patch ] - ++ - lib.optional (lib.versions.major release_version == "13") - # Revert of https://reviews.llvm.org/D100879 - # The malloc alignment assumption is incorrect for jemalloc and causes - # mis-compilation in firefox. - # See: https://bugzilla.mozilla.org/show_bug.cgi?id=1741454 - (getVersionFile "clang/revert-malloc-alignment-assumption.patch") - ++ lib.optional (lib.versionOlder release_version "17") ( - if lib.versionAtLeast release_version "14" then - fetchpatch { - name = "ignore-nostd-link.patch"; - url = "https://github.com/llvm/llvm-project/commit/5b77e752dcd073846b89559d6c0e1a7699e58615.patch"; - relative = "clang"; - hash = "sha256-qzSAmoGY+7POkDhcGgQRPaNQ3+7PIcIc9cZuiE/eLkc="; - } - else - ./ignore-nostd-link-13.diff - ) # Pass the correct path to libllvm ++ [ - (replaceVars - ( - if (lib.versionOlder release_version "16") then - ./clang-11-15-LLVMgold-path.patch - else - ./clang-at-least-16-LLVMgold-path.patch - ) - { - libllvmLibdir = "${libllvm.lib}/lib"; - } - ) + (replaceVars ./clang-at-least-16-LLVMgold-path.patch { + libllvmLibdir = "${libllvm.lib}/lib"; + }) ] - # Backport version logic from Clang 16. This is needed by the following patch. - ++ lib.optional (lib.versions.major release_version == "15") (fetchpatch { - name = "clang-darwin-Use-consistent-version-define-stringifying-logic.patch"; - url = "https://github.com/llvm/llvm-project/commit/60a33ded751c86fff9ac1c4bdd2b341fbe4b0649.patch?full_index=1"; - includes = [ "lib/Basic/Targets/OSTargets.cpp" ]; - stripLen = 1; - hash = "sha256-YVTSg5eZLz3po2AUczPNXCK26JA3CuTh6Iqp7hAAKIs="; - }) - # Backport `__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__` support from Clang 17. - # This is needed by newer SDKs (14+). - ++ - lib.optional - ( - lib.versionAtLeast (lib.versions.major release_version) "15" - && lib.versionOlder (lib.versions.major release_version) "17" - ) - (fetchpatch { - name = "clang-darwin-An-OS-version-preprocessor-define.patch"; - url = "https://github.com/llvm/llvm-project/commit/c8e2dd8c6f490b68e41fe663b44535a8a21dfeab.patch?full_index=1"; - includes = [ "lib/Basic/Targets/OSTargets.cpp" ]; - stripLen = 1; - hash = "sha256-Vs32kql7N6qtLqc12FtZHURcbenA7+N3E/nRRX3jdig="; - }) # Fixes a bunch of lambda-related crashes # https://github.com/llvm/llvm-project/pull/93206 ++ lib.optional (lib.versions.major release_version == "18") (fetchpatch { @@ -125,20 +70,17 @@ stdenv.mkDerivation ( ]; stripLen = 1; hash = "sha256-1NKej08R9SPlbDY/5b0OKUsHjX07i9brR84yXiPwi7E="; - }) - ++ - lib.optional (stdenv.isAarch64 && lib.versions.major release_version == "17") - # Fixes llvm17 tblgen builds on aarch64. - # https://github.com/llvm/llvm-project/issues/106521#issuecomment-2337175680 - (getVersionFile "clang/aarch64-tblgen.patch"); + }); nativeBuildInputs = [ cmake python3 + ninja + ] + ++ lib.optionals enableManpages [ + python3.pkgs.myst-parser + python3.pkgs.sphinx ] - ++ (lib.optional (lib.versionAtLeast release_version "15") ninja) - ++ lib.optional (lib.versionAtLeast version "18" && enableManpages) python3.pkgs.myst-parser - ++ lib.optional enableManpages python3.pkgs.sphinx ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; buildInputs = [ @@ -146,43 +88,42 @@ stdenv.mkDerivation ( libllvm ]; - cmakeFlags = - (lib.optionals (lib.versionAtLeast release_version "15") [ - (lib.cmakeFeature "CLANG_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/clang") - ]) - ++ [ - (lib.cmakeBool "CLANGD_BUILD_XPC" false) - (lib.cmakeBool "LLVM_ENABLE_RTTI" true) - (lib.cmakeFeature "LLVM_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/llvm-tblgen") - (lib.cmakeFeature "CLANG_TABLEGEN" "${buildLlvmTools.tblgen}/bin/clang-tblgen") - ] - ++ lib.optionals (lib.versionAtLeast release_version "21") [ - (lib.cmakeFeature "CLANG_RESOURCE_DIR" "${placeholder "lib"}/lib/clang/${lib.versions.major release_version}") - ] - ++ lib.optionals (lib.versionAtLeast release_version "17") [ - (lib.cmakeBool "LLVM_INCLUDE_TESTS" false) - ] - ++ lib.optionals enableManpages [ - (lib.cmakeBool "CLANG_INCLUDE_DOCS" true) - (lib.cmakeBool "LLVM_ENABLE_SPHINX" true) - (lib.cmakeBool "SPHINX_OUTPUT_MAN" true) - (lib.cmakeBool "SPHINX_OUTPUT_HTML" false) - (lib.cmakeBool "SPHINX_WARNINGS_AS_ERRORS" false) - ] - ++ lib.optionals (lib.versionAtLeast release_version "15") [ - # Added in LLVM15: - # `clang-tidy-confusable-chars-gen`: https://github.com/llvm/llvm-project/commit/c3574ef739fbfcc59d405985a3a4fa6f4619ecdb - # `clang-pseudo-gen`: https://github.com/llvm/llvm-project/commit/cd2292ef824591cc34cc299910a3098545c840c7 - (lib.cmakeFeature "CLANG_TIDY_CONFUSABLE_CHARS_GEN" "${buildLlvmTools.tblgen}/bin/clang-tidy-confusable-chars-gen") - ] - ++ lib.optionals (lib.versionOlder release_version "20") [ - # clang-pseudo removed in LLVM20: https://github.com/llvm/llvm-project/commit/ed8f78827895050442f544edef2933a60d4a7935 - (lib.cmakeFeature "CLANG_PSEUDO_GEN" "${buildLlvmTools.tblgen}/bin/clang-pseudo-gen") - ] - ++ lib.optional (lib.versionAtLeast release_version "20") ( - lib.cmakeFeature "LLVM_DIR" "${libllvm.dev}/lib/cmake/llvm" - ) - ++ devExtraCmakeFlags; + cmakeFlags = [ + (lib.cmakeFeature "CLANG_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/clang") + (lib.cmakeBool "CLANGD_BUILD_XPC" false) + (lib.cmakeBool "LLVM_ENABLE_RTTI" true) + (lib.cmakeFeature "LLVM_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/llvm-tblgen") + (lib.cmakeFeature "CLANG_TABLEGEN" "${buildLlvmTools.tblgen}/bin/clang-tblgen") + ] + ++ lib.optionals (lib.versionAtLeast release_version "21") [ + (lib.cmakeFeature "CLANG_RESOURCE_DIR" "${placeholder "lib"}/lib/clang/${lib.versions.major release_version}") + ] + # TODO: Clean up on `staging`. + ++ [ + (lib.cmakeBool "LLVM_INCLUDE_TESTS" false) + ] + ++ lib.optionals enableManpages [ + (lib.cmakeBool "CLANG_INCLUDE_DOCS" true) + (lib.cmakeBool "LLVM_ENABLE_SPHINX" true) + (lib.cmakeBool "SPHINX_OUTPUT_MAN" true) + (lib.cmakeBool "SPHINX_OUTPUT_HTML" false) + (lib.cmakeBool "SPHINX_WARNINGS_AS_ERRORS" false) + ] + # TODO: Clean up on `staging`. + ++ [ + # Added in LLVM15: + # `clang-tidy-confusable-chars-gen`: https://github.com/llvm/llvm-project/commit/c3574ef739fbfcc59d405985a3a4fa6f4619ecdb + # `clang-pseudo-gen`: https://github.com/llvm/llvm-project/commit/cd2292ef824591cc34cc299910a3098545c840c7 + (lib.cmakeFeature "CLANG_TIDY_CONFUSABLE_CHARS_GEN" "${buildLlvmTools.tblgen}/bin/clang-tidy-confusable-chars-gen") + ] + ++ lib.optionals (lib.versionOlder release_version "20") [ + # clang-pseudo removed in LLVM20: https://github.com/llvm/llvm-project/commit/ed8f78827895050442f544edef2933a60d4a7935 + (lib.cmakeFeature "CLANG_PSEUDO_GEN" "${buildLlvmTools.tblgen}/bin/clang-pseudo-gen") + ] + ++ lib.optional (lib.versionAtLeast release_version "20") ( + lib.cmakeFeature "LLVM_DIR" "${libllvm.dev}/lib/cmake/llvm" + ) + ++ devExtraCmakeFlags; postPatch = '' # Make sure clang passes the correct location of libLTO to ld64 @@ -206,10 +147,6 @@ stdenv.mkDerivation ( postInstall = '' ln -sv $out/bin/clang $out/bin/cpp '' - + (lib.optionalString (lib.versions.major release_version == "17") '' - mkdir -p $lib/lib/clang - mv $lib/lib/17 $lib/lib/clang/17 - '') + (lib.optionalString ((lib.versionAtLeast release_version "19") && !(lib.versionAtLeast release_version "21")) '' @@ -221,39 +158,21 @@ stdenv.mkDerivation ( # Move libclang to 'lib' output moveToOutput "lib/libclang.*" "$lib" moveToOutput "lib/libclang-cpp.*" "$lib" + mkdir -p $python/bin $python/share/clang/ '' - + ( - if lib.versionOlder release_version "15" then - '' - mkdir -p $python/bin $python/share/{clang,scan-view} - '' - else - '' - mkdir -p $python/bin $python/share/clang/ - '' - ) + '' mv $out/bin/{git-clang-format,scan-view} $python/bin if [ -e $out/bin/set-xcode-analyzer ]; then mv $out/bin/set-xcode-analyzer $python/bin fi mv $out/share/clang/*.py $python/share/clang - '' - + (lib.optionalString (lib.versionOlder release_version "15") '' - mv $out/share/scan-view/*.py $python/share/scan-view - '') - + '' rm $out/bin/c-index-test patchShebangs $python/bin mkdir -p $dev/bin '' + ( - if lib.versionOlder release_version "15" then - '' - cp bin/clang-tblgen $dev/bin - '' - else if lib.versionOlder release_version "20" then + if lib.versionOlder release_version "20" then '' cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen,clang-pseudo-gen} $dev/bin '' @@ -264,12 +183,7 @@ stdenv.mkDerivation ( ); env = - lib.optionalAttrs - ( - stdenv.buildPlatform != stdenv.hostPlatform - && !stdenv.hostPlatform.useLLVM - && lib.versionAtLeast release_version "15" - ) + lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform && !stdenv.hostPlatform.useLLVM) { # The following warning is triggered with (at least) gcc >= # 12, but appears to occur only for cross compiles. @@ -282,17 +196,10 @@ stdenv.mkDerivation ( hardeningUnsupportedFlagsByTargetPlatform = targetPlatform: [ "fortify3" ] + ++ lib.optional (!targetPlatform.isLinux || !targetPlatform.isx86_64) "shadowstack" + ++ lib.optional (!targetPlatform.isAarch64 || !targetPlatform.isLinux) "pacret" ++ lib.optional ( - (lib.versionOlder release_version "7") || !targetPlatform.isLinux || !targetPlatform.isx86_64 - ) "shadowstack" - ++ lib.optional ( - (lib.versionOlder release_version "8") || !targetPlatform.isAarch64 || !targetPlatform.isLinux - ) "pacret" - ++ lib.optional ( - (lib.versionOlder release_version "11") - || (targetPlatform.isAarch64 && (lib.versionOlder release_version "18.1")) - || (targetPlatform.isFreeBSD && (lib.versionOlder release_version "15")) - || !(targetPlatform.isLinux || targetPlatform.isFreeBSD) + !(targetPlatform.isLinux || targetPlatform.isFreeBSD) || !( targetPlatform.isx86 || targetPlatform.isPower64 @@ -300,11 +207,7 @@ stdenv.mkDerivation ( || targetPlatform.isAarch64 ) ) "stackclashprotection" - ++ lib.optional ( - (lib.versionOlder release_version "15") || !(targetPlatform.isx86_64 || targetPlatform.isAarch64) - ) "zerocallusedregs" - ++ lib.optional (lib.versionOlder release_version "15") "strictflexarrays1" - ++ lib.optional (lib.versionOlder release_version "16") "strictflexarrays3" + ++ lib.optional (!(targetPlatform.isx86_64 || targetPlatform.isAarch64)) "zerocallusedregs" ++ (finalAttrs.passthru.hardeningUnsupportedFlags or [ ]); }; @@ -326,35 +229,23 @@ stdenv.mkDerivation ( mainProgram = "clang"; }; } - // lib.optionalAttrs enableManpages ( - { - pname = "clang-manpages"; + // lib.optionalAttrs enableManpages { + pname = "clang-manpages"; - installPhase = '' - mkdir -p $out/share/man/man1 - # Manually install clang manpage - cp docs/man/*.1 $out/share/man/man1/ - ''; + ninjaFlags = [ "docs-clang-man" ]; - outputs = [ "out" ]; + installPhase = '' + mkdir -p $out/share/man/man1 + # Manually install clang manpage + cp docs/man/*.1 $out/share/man/man1/ + ''; - doCheck = false; + outputs = [ "out" ]; - meta = llvm_meta // { - description = "man page for Clang ${version}"; - }; - } - // ( - if lib.versionOlder release_version "15" then - { - buildPhase = '' - make docs-clang-man - ''; - } - else - { - ninjaFlags = [ "docs-clang-man" ]; - } - ) - ) + doCheck = false; + + meta = llvm_meta // { + description = "man page for Clang ${version}"; + }; + } ) diff --git a/pkgs/development/compilers/llvm/common/clang/ignore-nostd-link-13.diff b/pkgs/development/compilers/llvm/common/clang/ignore-nostd-link-13.diff deleted file mode 100644 index 9a7a18a4c5ad..000000000000 --- a/pkgs/development/compilers/llvm/common/clang/ignore-nostd-link-13.diff +++ /dev/null @@ -1,57 +0,0 @@ -backported to clang-12 & clang-13 from https://github.com/llvm/llvm-project/commit/5b77e752dcd073846b89559d6c0e1a7699e58615 -diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td -index a0cbcae..8797646 100644 ---- a/include/clang/Driver/Options.td -+++ b/include/clang/Driver/Options.td -@@ -2931,7 +2931,7 @@ def headerpad__max__install__names : Joined<["-"], "headerpad_max_install_names" - def help : Flag<["-", "--"], "help">, Flags<[CC1Option,CC1AsOption, FC1Option, - FlangOption]>, HelpText<"Display available options">, - MarshallingInfoFlag>; --def ibuiltininc : Flag<["-"], "ibuiltininc">, -+def ibuiltininc : Flag<["-"], "ibuiltininc">, Group, - HelpText<"Enable builtin #include directories even when -nostdinc is used " - "before or after -ibuiltininc. " - "Using -nobuiltininc after the option disables it">; -@@ -3641,10 +3641,11 @@ def no_cpp_precomp : Flag<["-"], "no-cpp-precomp">, Group - def no_integrated_cpp : Flag<["-", "--"], "no-integrated-cpp">, Flags<[NoXarchOption]>; - def no_pedantic : Flag<["-", "--"], "no-pedantic">, Group; - def no__dead__strip__inits__and__terms : Flag<["-"], "no_dead_strip_inits_and_terms">; --def nobuiltininc : Flag<["-"], "nobuiltininc">, Flags<[CC1Option, CoreOption]>, -+def nobuiltininc : Flag<["-"], "nobuiltininc">, Flags<[CC1Option, CoreOption]>, Group, - HelpText<"Disable builtin #include directories">, - MarshallingInfoNegativeFlag>; --def nogpuinc : Flag<["-"], "nogpuinc">, HelpText<"Do not add include paths for CUDA/HIP and" -+def nogpuinc : Flag<["-"], "nogpuinc">, Group, -+ HelpText<"Do not add include paths for CUDA/HIP and" - " do not include the default CUDA/HIP wrapper headers">; - def : Flag<["-"], "nocudainc">, Alias; - def nogpulib : Flag<["-"], "nogpulib">, -@@ -3660,9 +3661,9 @@ def noprebind : Flag<["-"], "noprebind">; - def noprofilelib : Flag<["-"], "noprofilelib">; - def noseglinkedit : Flag<["-"], "noseglinkedit">; - def nostartfiles : Flag<["-"], "nostartfiles">, Group; --def nostdinc : Flag<["-"], "nostdinc">, Flags<[CoreOption]>; --def nostdlibinc : Flag<["-"], "nostdlibinc">; --def nostdincxx : Flag<["-"], "nostdinc++">, Flags<[CC1Option]>, -+def nostdinc : Flag<["-"], "nostdinc">, Flags<[CoreOption]>, Group; -+def nostdlibinc : Flag<["-"], "nostdlibinc">, Group; -+def nostdincxx : Flag<["-"], "nostdinc++">, Flags<[CC1Option]>, Group, - HelpText<"Disable standard #include directories for the C++ standard library">, - MarshallingInfoNegativeFlag>; - def nostdlib : Flag<["-"], "nostdlib">, Group; -diff --git a/test/Driver/linker-opts.c b/test/Driver/linker-opts.c -index e1673f7..b9beb91 100644 ---- a/test/Driver/linker-opts.c -+++ b/test/Driver/linker-opts.c -@@ -16,9 +16,8 @@ - // - // Make sure that we don't warn on unused compiler arguments. - // RUN: %clang -Xclang -I. -x c %s -c -o %t/tmp.o --// RUN: %clang -Xclang -I. %t/tmp.o -o %t/tmp -### 2>&1 | FileCheck %s --check-prefix=NO-UNUSED --// NO-UNUSED-NOT: warning:{{.*}}unused --// -+// RUN: %clang -### -I. -ibuiltininc -nobuiltininc -nostdinc -nostdinc++ -nostdlibinc -nogpuinc %t/tmp.o -o /dev/null 2>&1 | FileCheck /dev/null --implicit-check-not=warning: -+ - // Make sure that we do warn in other cases. - // RUN: %clang %s -lfoo -c -o %t/tmp2.o -### 2>&1 | FileCheck %s --check-prefix=UNUSED - // UNUSED: warning:{{.*}}unused diff --git a/pkgs/development/compilers/llvm/common/common-let.nix b/pkgs/development/compilers/llvm/common/common-let.nix index 1a17e39a0690..c310a8ab96fc 100644 --- a/pkgs/development/compilers/llvm/common/common-let.nix +++ b/pkgs/development/compilers/llvm/common/common-let.nix @@ -31,9 +31,9 @@ rec { ++ lib.platforms.s390x ++ lib.platforms.wasi ++ lib.platforms.x86 - ++ lib.optionals (lib.versionAtLeast release_version "7") lib.platforms.riscv - ++ lib.optionals (lib.versionAtLeast release_version "14") lib.platforms.m68k - ++ lib.optionals (lib.versionAtLeast release_version "16") lib.platforms.loongarch64; + ++ lib.platforms.riscv + ++ lib.platforms.m68k + ++ lib.platforms.loongarch64; }; releaseInfo = diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-mcr-dmb.patch b/pkgs/development/compilers/llvm/common/compiler-rt/armv6-mcr-dmb.patch deleted file mode 100644 index acdcc9e983b8..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-mcr-dmb.patch +++ /dev/null @@ -1,75 +0,0 @@ -From a11d1cc41c725ec6dee58f75e4a852a658dd7543 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 10 Mar 2022 19:30:00 -0800 -Subject: [PATCH] [builtins] Use mcr for dmb instruction on armv6 - -At present compiler-rt cross compiles for armv6 ( -march=armv6 ) but includes -dmb instructions which are only available in armv7+ this causes SIGILL on -clang+compiler-rt compiled components on rpi0w platforms. - -Reviewed By: MaskRay - -Differential Revision: https://reviews.llvm.org/D99282 ---- - compiler-rt/lib/builtins/arm/sync-ops.h | 8 ++++---- - compiler-rt/lib/builtins/assembly.h | 8 ++++++++ - 2 files changed, 12 insertions(+), 4 deletions(-) - -diff --git a/lib/builtins/arm/sync-ops.h b/lib/builtins/arm/sync-ops.h -index c9623249e5d20..7a26170741ad2 100644 ---- a/lib/builtins/arm/sync-ops.h -+++ b/lib/builtins/arm/sync-ops.h -@@ -19,14 +19,14 @@ - .thumb; \ - .syntax unified; \ - DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ -- dmb; \ -+ DMB; \ - mov r12, r0; \ - LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \ - op(r2, r0, r1); \ - strex r3, r2, [r12]; \ - cmp r3, #0; \ - bne LOCAL_LABEL(tryatomic_##op); \ -- dmb; \ -+ DMB; \ - bx lr - - #define SYNC_OP_8(op) \ -@@ -35,14 +35,14 @@ - .syntax unified; \ - DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ - push {r4, r5, r6, lr}; \ -- dmb; \ -+ DMB; \ - mov r12, r0; \ - LOCAL_LABEL(tryatomic_##op) : ldrexd r0, r1, [r12]; \ - op(r4, r5, r0, r1, r2, r3); \ - strexd r6, r4, r5, [r12]; \ - cmp r6, #0; \ - bne LOCAL_LABEL(tryatomic_##op); \ -- dmb; \ -+ DMB; \ - pop { r4, r5, r6, pc } - - #define MINMAX_4(rD, rN, rM, cmp_kind) \ -diff --git a/lib/builtins/assembly.h b/lib/builtins/assembly.h -index 69a3d8620f924..06aa18162e3b4 100644 ---- a/lib/builtins/assembly.h -+++ b/lib/builtins/assembly.h -@@ -189,6 +189,14 @@ - JMP(ip) - #endif - -+#if __ARM_ARCH >= 7 -+#define DMB dmb -+#elif __ARM_ARCH >= 6 -+#define DMB mcr p15, #0, r0, c7, c10, #5 -+#else -+#error only supported on ARMv6+ -+#endif -+ - #if defined(USE_THUMB_2) - #define WIDE(op) op.w - #else - diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-scudo-no-yield.patch b/pkgs/development/compilers/llvm/common/compiler-rt/armv6-scudo-no-yield.patch deleted file mode 100644 index 2fd48eda6518..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-scudo-no-yield.patch +++ /dev/null @@ -1,34 +0,0 @@ -From ff0b373b959165477f45d9f5f9a8da471ae111ab Mon Sep 17 00:00:00 2001 -From: Ben Wolsieffer -Date: Wed, 7 Dec 2022 18:03:56 -0500 -Subject: [PATCH] [scudo][standalone] Only use yield on ARMv6K and newer - -The yield instruction is only available in ARMv6K and newer. It behaves as a -nop on single threaded platforms anyway, so use nop instead on unsupported -architectures. - -Differential Revision: https://reviews.llvm.org/D139600 ---- - compiler-rt/lib/scudo/standalone/common.h | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/lib/scudo/standalone/common.h b/lib/scudo/standalone/common.h -index bc3dfec6dbba..862cda1d4bc4 100644 ---- a/lib/scudo/standalone/common.h -+++ b/lib/scudo/standalone/common.h -@@ -109,7 +109,12 @@ inline void yieldProcessor(u8 Count) { - #elif defined(__aarch64__) || defined(__arm__) - __asm__ __volatile__("" ::: "memory"); - for (u8 I = 0; I < Count; I++) -+#if __ARM_ARCH >= 6 && !defined(__ARM_ARCH_6__) -+ // yield is supported on ARMv6K and newer - __asm__ __volatile__("yield"); -+#else -+ __asm__ __volatile__("nop"); -+#endif - #endif - __asm__ __volatile__("" ::: "memory"); - } --- -2.38.1 - diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-sync-ops-no-thumb.patch b/pkgs/development/compilers/llvm/common/compiler-rt/armv6-sync-ops-no-thumb.patch deleted file mode 100644 index 098a155d448c..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-sync-ops-no-thumb.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 5017de8ba4b1fe985169cf54590e858a9019a91f Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 11 Mar 2022 16:25:49 -0800 -Subject: [PATCH] [builtins] Do not force thumb mode directive in - arm/sync-ops.h - -.thumb_func was not switching mode until [1] -so it did not show up but now that .thumb_func (without argument) is -switching mode, its causing build failures on armv6 ( rpi0 ) even when -build is explicitly asking for this file to be built with -marm (ARM -mode), therefore use DEFINE_COMPILERRT_FUNCTION macro to add function -header which considers arch and mode from compiler cmdline to decide if -the function is built using thumb mode or arm mode. - -[1] https://reviews.llvm.org/D101975 - -Note that it also needs https://reviews.llvm.org/D99282 - -Reviewed By: peter.smith, MaskRay - -Differential Revision: https://reviews.llvm.org/D104183 ---- - compiler-rt/lib/builtins/arm/sync-ops.h | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/lib/builtins/arm/sync-ops.h b/lib/builtins/arm/sync-ops.h -index 7a26170741ad2..d914f9d3a1093 100644 ---- a/lib/builtins/arm/sync-ops.h -+++ b/lib/builtins/arm/sync-ops.h -@@ -16,9 +16,8 @@ - - #define SYNC_OP_4(op) \ - .p2align 2; \ -- .thumb; \ - .syntax unified; \ -- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ -+ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ - DMB; \ - mov r12, r0; \ - LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \ -@@ -31,9 +30,8 @@ - - #define SYNC_OP_8(op) \ - .p2align 2; \ -- .thumb; \ - .syntax unified; \ -- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ -+ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ - push {r4, r5, r6, lr}; \ - DMB; \ - mov r12, r0; \ - diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/armv7l-15.patch b/pkgs/development/compilers/llvm/common/compiler-rt/armv7l-15.patch deleted file mode 100644 index ca1c2332abd9..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/armv7l-15.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff -ur a/cmake/builtin-config-ix.cmake b/cmake/builtin-config-ix.cmake ---- a/cmake/builtin-config-ix.cmake @llvm 15.0.6 -+++ b/cmake/builtin-config-ix.cmake -@@ -46,7 +46,7 @@ - - set(ARM64 aarch64) --set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv8m.main armv8.1m.main) -+set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l armv8m.main armv8.1m.main) - set(AVR avr) - set(HEXAGON hexagon) - set(X86 i386) - set(X86_64 x86_64) -diff -ur a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt ---- a/lib/builtins/CMakeLists.txt @llvm 15.0.6 -+++ b/lib/builtins/CMakeLists.txt -@@ -565,6 +565,7 @@ - set(armv7_SOURCES ${arm_SOURCES}) - set(armv7s_SOURCES ${arm_SOURCES}) - set(armv7k_SOURCES ${arm_SOURCES}) -+set(armv7l_SOURCES ${arm_SOURCES}) - set(arm64_SOURCES ${aarch64_SOURCES}) - - # macho_embedded archs -@@ -734,7 +735,7 @@ - foreach (arch ${BUILTIN_SUPPORTED_ARCH}) - if (CAN_TARGET_${arch}) - # For ARM archs, exclude any VFP builtins if VFP is not supported -- if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em|armv8m.main|armv8.1m.main)$") -+ if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em|armv8m.main|armv8.1m.main)$") - string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}") - check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP) - if(NOT COMPILER_RT_HAS_${arch}_VFP) diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/default.nix b/pkgs/development/compilers/llvm/common/compiler-rt/default.nix index b077b25b7a51..16435b062637 100644 --- a/pkgs/development/compilers/llvm/common/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/common/compiler-rt/default.nix @@ -41,10 +41,7 @@ let # TODO: Make this account for GCC having libstdcxx, which will help # use clean up the `cmakeFlags` rats nest below. haveLibcxx = stdenv.cc.libcxx != null; - isDarwinStatic = - stdenv.hostPlatform.isDarwin - && stdenv.hostPlatform.isStatic - && lib.versionAtLeast release_version "16"; + isDarwinStatic = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isStatic; inherit (stdenv.hostPlatform) isMusl isAarch64 isWindows; noSanitizers = !haveLibc || bareMetal || isMusl || isDarwinStatic || isWindows; in @@ -58,8 +55,6 @@ stdenv.mkDerivation (finalAttrs: { runCommand "compiler-rt-src-${version}" { inherit (monorepoSrc) passthru; } ( '' mkdir -p "$out" - '' - + lib.optionalString (lib.versionAtLeast release_version "14") '' cp -r ${monorepoSrc}/cmake "$out" '' + lib.optionalString (lib.versionAtLeast release_version "21") '' @@ -74,76 +69,31 @@ stdenv.mkDerivation (finalAttrs: { sourceRoot = "${finalAttrs.src.name}/compiler-rt"; - patches = - lib.optional (lib.versionOlder release_version "15") (getVersionFile "compiler-rt/codesign.patch") # Revert compiler-rt commit that makes codesign mandatory - ++ [ - (getVersionFile "compiler-rt/X86-support-extension.patch") # Add support for i486 i586 i686 by reusing i386 config - # ld-wrapper dislikes `-rpath-link //nix/store`, so we normalize away the - # extra `/`. - (getVersionFile "compiler-rt/normalize-var.patch") - # Fix build on armv6l - ./armv6-no-ldrexd-strexd.patch - ] - ++ lib.optional (lib.versions.major release_version == "12") (fetchpatch { - # fixes the parallel build on aarch64 darwin - name = "fix-symlink-race-aarch64-darwin.patch"; - url = "https://github.com/llvm/llvm-project/commit/b31080c596246bc26d2493cfd5e07f053cf9541c.patch"; - relative = "compiler-rt"; - hash = "sha256-Cv2NC8402yU7QaTR6TzdH+qyWRy+tTote7KKWtKRWFQ="; - }) - ++ lib.optional ( - lib.versions.major release_version == "12" - || (lib.versionAtLeast release_version "14" && lib.versionOlder release_version "18") - ) (getVersionFile "compiler-rt/gnu-install-dirs.patch") - ++ - lib.optional (lib.versionAtLeast release_version "13" && lib.versionOlder release_version "18") - (fetchpatch { - name = "cfi_startproc-after-label.patch"; - url = "https://github.com/llvm/llvm-project/commit/7939ce39dac0078fef7183d6198598b99c652c88.patch"; - stripLen = 1; - hash = "sha256-tGqXsYvUllFrPa/r/dsKVlwx5IrcJGccuR1WAtUg7/o="; - }) - ++ - lib.optional (lib.versionAtLeast release_version "13" && lib.versionOlder release_version "18") - # Prevent a compilation error on darwin - (getVersionFile "compiler-rt/darwin-targetconditionals.patch") - # TODO: make unconditional and remove in <15 section below. Causes rebuilds. - ++ lib.optionals (lib.versionAtLeast release_version "15") [ - # See: https://github.com/NixOS/nixpkgs/pull/186575 - ./darwin-plistbuddy-workaround.patch - ] - ++ - lib.optional (lib.versions.major release_version == "15") - # See: https://github.com/NixOS/nixpkgs/pull/194634#discussion_r999829893 - ./armv7l-15.patch - ++ lib.optionals (lib.versionOlder release_version "15") [ - ./darwin-plistbuddy-workaround.patch - (getVersionFile "compiler-rt/armv7l.patch") - # Fix build on armv6l - ./armv6-mcr-dmb.patch - ./armv6-sync-ops-no-thumb.patch - ] - ++ - lib.optionals (lib.versionAtLeast release_version "13" && lib.versionOlder release_version "18") - [ - # Fix build on armv6l - ./armv6-scudo-no-yield.patch - ] - ++ lib.optionals (lib.versionAtLeast release_version "13") [ - (getVersionFile "compiler-rt/armv6-scudo-libatomic.patch") - ] - ++ lib.optional (lib.versions.major release_version == "19") (fetchpatch { - url = "https://github.com/llvm/llvm-project/pull/99837/commits/14ae0a660a38e1feb151928a14f35ff0f4487351.patch"; - hash = "sha256-JykABCaNNhYhZQxCvKiBn54DZ5ZguksgCHnpdwWF2no="; - relative = "compiler-rt"; - }); + patches = [ + (getVersionFile "compiler-rt/X86-support-extension.patch") # Add support for i486 i586 i686 by reusing i386 config + # ld-wrapper dislikes `-rpath-link //nix/store`, so we normalize away the + # extra `/`. + (getVersionFile "compiler-rt/normalize-var.patch") + # Fix build on armv6l + ./armv6-no-ldrexd-strexd.patch + # See: https://github.com/NixOS/nixpkgs/pull/186575 + ./darwin-plistbuddy-workaround.patch + ] + ++ [ + (getVersionFile "compiler-rt/armv6-scudo-libatomic.patch") + ] + ++ lib.optional (lib.versions.major release_version == "19") (fetchpatch { + url = "https://github.com/llvm/llvm-project/pull/99837/commits/14ae0a660a38e1feb151928a14f35ff0f4487351.patch"; + hash = "sha256-JykABCaNNhYhZQxCvKiBn54DZ5ZguksgCHnpdwWF2no="; + relative = "compiler-rt"; + }); nativeBuildInputs = [ cmake python3 libllvm.dev + ninja ] - ++ (lib.optional (lib.versionAtLeast release_version "15") ninja) ++ lib.optionals stdenv.hostPlatform.isDarwin [ jq ]; buildInputs = lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isRiscV) linuxHeaders @@ -181,12 +131,6 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeFeature "SANITIZER_CXX_ABI_LIBNAME" "libcxxabi") (lib.cmakeBool "COMPILER_RT_USE_BUILTINS_LIBRARY" true) ] - ++ - lib.optionals - ((!haveLibc || bareMetal || isMusl || isAarch64) && (lib.versions.major release_version == "13")) - [ - (lib.cmakeBool "COMPILER_RT_BUILD_LIBFUZZER" false) - ] ++ lib.optionals (useLLVM && haveLibc) [ (lib.cmakeBool "COMPILER_RT_BUILD_SANITIZERS" true) (lib.cmakeBool "COMPILER_RT_BUILD_PROFILE" true) @@ -221,7 +165,7 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeFeature "COMPILER_RT_OS_DIR" "baremetal") ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) ( - lib.optionals (lib.versionAtLeast release_version "16") [ + [ (lib.cmakeFeature "CMAKE_LIPO" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}lipo") ] ++ lib.optionals (!haveLibcxx) [ @@ -234,8 +178,6 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeFeature "DARWIN_osx_ARCHS" stdenv.hostPlatform.darwinArch) (lib.cmakeFeature "DARWIN_osx_BUILTIN_ARCHS" stdenv.hostPlatform.darwinArch) (lib.cmakeFeature "SANITIZER_MIN_OSX_VERSION" stdenv.hostPlatform.darwinMinVersion) - ] - ++ lib.optionals (lib.versionAtLeast release_version "15") [ # `COMPILER_RT_DEFAULT_TARGET_ONLY` does not apply to Darwin: # https://github.com/llvm/llvm-project/blob/27ef42bec80b6c010b7b3729ed0528619521a690/compiler-rt/cmake/base-config-ix.cmake#L153 (lib.cmakeBool "COMPILER_RT_ENABLE_IOS" false) @@ -276,21 +218,11 @@ stdenv.mkDerivation (finalAttrs: { '' substituteInPlace lib/builtins/clear_cache.c \ --replace-fail "#include " "" - substituteInPlace lib/builtins/cpu_model${lib.optionalString (lib.versionAtLeast release_version "18") "/x86"}.c \ + substituteInPlace lib/builtins/cpu_model/x86.c \ --replace-fail "#include " "" '' ) ) - + - lib.optionalString - (lib.versionAtLeast release_version "13" && lib.versionOlder release_version "14") - '' - # https://github.com/llvm/llvm-project/blob/llvmorg-14.0.6/libcxx/utils/merge_archives.py - # Seems to only be used in v13 though it's present in v12 and v14, and dropped in v15. - substituteInPlace ../libcxx/utils/merge_archives.py \ - --replace-fail "import distutils.spawn" "from shutil import which as find_executable" \ - --replace-fail "distutils.spawn." "" - '' + lib.optionalString (lib.versionAtLeast release_version "19") # codesign in sigtool doesn't support the various options used by the build @@ -301,16 +233,12 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail 'find_program(CODESIGN codesign)' "" ''; - preConfigure = - lib.optionalString (lib.versionOlder release_version "16" && !haveLibc) '' - cmakeFlagsArray+=(-DCMAKE_C_FLAGS="-nodefaultlibs -ffreestanding") - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - cmakeFlagsArray+=( - "-DDARWIN_macosx_CACHED_SYSROOT=$SDKROOT" - "-DDARWIN_macosx_OVERRIDE_SDK_VERSION=$(jq -r .Version "$SDKROOT/SDKSettings.json")" - ) - ''; + preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin '' + cmakeFlagsArray+=( + "-DDARWIN_macosx_CACHED_SYSROOT=$SDKROOT" + "-DDARWIN_macosx_OVERRIDE_SDK_VERSION=$(jq -r .Version "$SDKROOT/SDKSettings.json")" + ) + ''; # Hack around weird upstream RPATH bug postInstall = diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/glibc.patch b/pkgs/development/compilers/llvm/common/compiler-rt/glibc.patch deleted file mode 100644 index 2d211795fc80..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/glibc.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc -index 54da635..c5dc1cd 100644 ---- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc -+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc -@@ -1158,8 +1158,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid); - CHECK_SIZE_AND_OFFSET(ipc_perm, gid); - CHECK_SIZE_AND_OFFSET(ipc_perm, cuid); - CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); --#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21) --/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */ -+#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31) -+/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit -+ on many architectures. */ - CHECK_SIZE_AND_OFFSET(ipc_perm, mode); - #endif - -diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/lib/sanitizer_common/sanitizer_platform_limits_posix.h -index f89a113..f6f986f 100644 ---- a/lib/sanitizer_common/sanitizer_platform_limits_posix.h -+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h -@@ -213,26 +213,13 @@ namespace __sanitizer { - u64 __unused1; - u64 __unused2; - #elif defined(__sparc__) --#if defined(__arch64__) - unsigned mode; -- unsigned short __pad1; --#else -- unsigned short __pad1; -- unsigned short mode; - unsigned short __pad2; --#endif - unsigned short __seq; - unsigned long long __unused1; - unsigned long long __unused2; --#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__) -- unsigned int mode; -- unsigned short __seq; -- unsigned short __pad1; -- unsigned long __unused1; -- unsigned long __unused2; - #else -- unsigned short mode; -- unsigned short __pad1; -+ unsigned int mode; - unsigned short __seq; - unsigned short __pad2; - #if defined(__x86_64__) && !defined(_LP64) diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/libsanitizer-no-cyclades-9.patch b/pkgs/development/compilers/llvm/common/compiler-rt/libsanitizer-no-cyclades-9.patch deleted file mode 100644 index 7ef02a169269..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/libsanitizer-no-cyclades-9.patch +++ /dev/null @@ -1,80 +0,0 @@ -https://github.com/llvm/llvm-project/commit/68d5235cb58f988c71b403334cd9482d663841ab.patch -https://reviews.llvm.org/D102059 ---- a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc -+++ b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc -@@ -370,15 +370,6 @@ static void ioctl_table_fill() { - - #if SANITIZER_GLIBC - // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE -- _(CYGETDEFTHRESH, WRITE, sizeof(int)); -- _(CYGETDEFTIMEOUT, WRITE, sizeof(int)); -- _(CYGETMON, WRITE, struct_cyclades_monitor_sz); -- _(CYGETTHRESH, WRITE, sizeof(int)); -- _(CYGETTIMEOUT, WRITE, sizeof(int)); -- _(CYSETDEFTHRESH, NONE, 0); -- _(CYSETDEFTIMEOUT, NONE, 0); -- _(CYSETTHRESH, NONE, 0); -- _(CYSETTIMEOUT, NONE, 0); - _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz); - _(EQL_ENSLAVE, WRITE, struct_ifreq_sz); - _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz); ---- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc -+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc -@@ -143,7 +143,6 @@ typedef struct user_fpregs elf_fpregset_t; - # include - #endif - #include --#include - #include - #include - #include -@@ -460,7 +459,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); - - #if SANITIZER_GLIBC - unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct); -- unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor); - #if EV_VERSION > (0x010000) - unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry); - #else -@@ -824,15 +822,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); - #endif // SANITIZER_LINUX - - #if SANITIZER_LINUX && !SANITIZER_ANDROID -- unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH; -- unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT; -- unsigned IOCTL_CYGETMON = CYGETMON; -- unsigned IOCTL_CYGETTHRESH = CYGETTHRESH; -- unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT; -- unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH; -- unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT; -- unsigned IOCTL_CYSETTHRESH = CYSETTHRESH; -- unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT; - unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE; - unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE; - unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG; ---- a/lib/sanitizer_common/sanitizer_platform_limits_posix.h -+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h -@@ -983,7 +983,6 @@ extern unsigned struct_vt_mode_sz; - - #if SANITIZER_LINUX && !SANITIZER_ANDROID - extern unsigned struct_ax25_parms_struct_sz; -- extern unsigned struct_cyclades_monitor_sz; - extern unsigned struct_input_keymap_entry_sz; - extern unsigned struct_ipx_config_data_sz; - extern unsigned struct_kbdiacrs_sz; -@@ -1328,15 +1327,6 @@ extern unsigned IOCTL_VT_WAITACTIVE; - #endif // SANITIZER_LINUX - - #if SANITIZER_LINUX && !SANITIZER_ANDROID -- extern unsigned IOCTL_CYGETDEFTHRESH; -- extern unsigned IOCTL_CYGETDEFTIMEOUT; -- extern unsigned IOCTL_CYGETMON; -- extern unsigned IOCTL_CYGETTHRESH; -- extern unsigned IOCTL_CYGETTIMEOUT; -- extern unsigned IOCTL_CYSETDEFTHRESH; -- extern unsigned IOCTL_CYSETDEFTIMEOUT; -- extern unsigned IOCTL_CYSETTHRESH; -- extern unsigned IOCTL_CYSETTIMEOUT; - extern unsigned IOCTL_EQL_EMANCIPATE; - extern unsigned IOCTL_EQL_ENSLAVE; - extern unsigned IOCTL_EQL_GETMASTRCFG; diff --git a/pkgs/development/compilers/llvm/common/default.nix b/pkgs/development/compilers/llvm/common/default.nix index f5c478f88e13..5de10bf97f0e 100644 --- a/pkgs/development/compilers/llvm/common/default.nix +++ b/pkgs/development/compilers/llvm/common/default.nix @@ -115,11 +115,7 @@ let tools: let callPackage = newScope (tools // args // metadata); - clangVersion = - if (lib.versionOlder metadata.release_version "16") then - metadata.release_version - else - lib.versions.major metadata.release_version; + clangVersion = lib.versions.major metadata.release_version; mkExtraBuildCommands0 = cc: '' @@ -175,12 +171,7 @@ let # to replacements depending on the llvm outpath (e.g. the LLVMgold patch). # So take the only patch known to be necessary. (metadata.getVersionFile "clang/gnu-install-dirs.patch") - ] - ++ - lib.optional (stdenv.isAarch64 && lib.versions.major metadata.release_version == "17") - # Fixes llvm17 tblgen builds on aarch64. - # https://github.com/llvm/llvm-project/issues/106521#issuecomment-2337175680 - (metadata.getVersionFile "clang/aarch64-tblgen.patch"); + ]; }; libclang = callPackage ./clang { @@ -242,18 +233,12 @@ let lib.recurseIntoAttrs { llef = callPackage ./lldb-plugins/llef.nix { }; } ); - lldb = callPackage ./lldb ( - { - } - // lib.optionalAttrs (lib.versions.major metadata.release_version == "16") { - src = callPackage ( - { runCommand }: - runCommand "lldb-src-${metadata.version}" { } '' - mkdir -p "$out" - cp -r ${monorepoSrc}/cmake "$out" - cp -r ${monorepoSrc}/lldb "$out" - '' - ) { }; + lldb = callPackage ./lldb { }; + + lldb-manpages = lowPrio ( + tools.lldb.override { + enableManpages = true; + python3 = pkgs.python3; # don't use python-boot } ); @@ -273,179 +258,107 @@ let bintools = wrapBintoolsWith { bintools = tools.bintools-unwrapped; }; - clangUseLLVM = wrapCCWith ( - rec { - cc = tools.clang-unwrapped; - libcxx = targetLlvmLibraries.libcxx; - bintools = bintools'; - extraPackages = [ - targetLlvmLibraries.compiler-rt - ] - ++ lib.optionals (!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD) [ - targetLlvmLibraries.libunwind - ]; - extraBuildCommands = - lib.optionalString (lib.versions.major metadata.release_version == "13") ( - '' - echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags - echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags - '' - + lib.optionalString (!stdenv.targetPlatform.isWasm) '' - echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags - echo "-L${targetLlvmLibraries.libunwind}/lib" >> $out/nix-support/cc-ldflags - '' - + lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) '' - echo "-lunwind" >> $out/nix-support/cc-ldflags - '' - + lib.optionalString stdenv.targetPlatform.isWasm '' - echo "-fno-exceptions" >> $out/nix-support/cc-cflags - '' + clangUseLLVM = wrapCCWith rec { + cc = tools.clang-unwrapped; + libcxx = targetLlvmLibraries.libcxx; + bintools = bintools'; + extraPackages = [ + targetLlvmLibraries.compiler-rt + ] + ++ lib.optionals (!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD) [ + targetLlvmLibraries.libunwind + ]; + extraBuildCommands = mkExtraBuildCommands cc; + nixSupport.cc-cflags = [ + "-rtlib=compiler-rt" + "-Wno-unused-command-line-argument" + "-B${targetLlvmLibraries.compiler-rt}/lib" + ] + ++ lib.optional ( + !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD + ) "--unwindlib=libunwind" + ++ lib.optional ( + !stdenv.targetPlatform.isWasm + && !stdenv.targetPlatform.isFreeBSD + && stdenv.targetPlatform.useLLVM or false + ) "-lunwind" + ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; + nixSupport.cc-ldflags = lib.optionals ( + !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD + ) [ "-L${targetLlvmLibraries.libunwind}/lib" ]; + }; + + clangWithLibcAndBasicRtAndLibcxx = wrapCCWith rec { + cc = tools.clang-unwrapped; + libcxx = targetLlvmLibraries.libcxx; + bintools = bintools'; + extraPackages = [ + targetLlvmLibraries.compiler-rt-no-libc + ] + ++ + lib.optionals + ( + !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin ) - + mkExtraBuildCommands cc; - } - // lib.optionalAttrs (lib.versionAtLeast metadata.release_version "14") { - nixSupport.cc-cflags = [ - "-rtlib=compiler-rt" - "-Wno-unused-command-line-argument" - "-B${targetLlvmLibraries.compiler-rt}/lib" - ] - ++ lib.optional ( - !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD - ) "--unwindlib=libunwind" - ++ lib.optional ( - !stdenv.targetPlatform.isWasm - && !stdenv.targetPlatform.isFreeBSD - && stdenv.targetPlatform.useLLVM or false - ) "-lunwind" - ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; - nixSupport.cc-ldflags = lib.optionals ( - !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD - ) [ "-L${targetLlvmLibraries.libunwind}/lib" ]; - } - ); + [ + targetLlvmLibraries.libunwind + ]; + extraBuildCommands = mkExtraBuildCommandsBasicRt cc; + nixSupport.cc-cflags = [ + "-rtlib=compiler-rt" + "-Wno-unused-command-line-argument" + "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" + ] + ++ lib.optional ( + !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin + ) "--unwindlib=libunwind" + ++ lib.optional ( + !stdenv.targetPlatform.isWasm + && !stdenv.targetPlatform.isFreeBSD + && stdenv.targetPlatform.useLLVM or false + ) "-lunwind" + ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; + nixSupport.cc-ldflags = lib.optionals ( + !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin + ) [ "-L${targetLlvmLibraries.libunwind}/lib" ]; + }; - clangWithLibcAndBasicRtAndLibcxx = wrapCCWith ( - rec { - cc = tools.clang-unwrapped; - libcxx = targetLlvmLibraries.libcxx; - bintools = bintools'; - extraPackages = [ - targetLlvmLibraries.compiler-rt-no-libc - ] - ++ - lib.optionals - ( - !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin - ) - [ - targetLlvmLibraries.libunwind - ]; - extraBuildCommands = - lib.optionalString (lib.versions.major metadata.release_version == "13") ( - '' - echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags - echo "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" >> $out/nix-support/cc-cflags - '' - + lib.optionalString (!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isDarwin) '' - echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags - echo "-L${targetLlvmLibraries.libunwind}/lib" >> $out/nix-support/cc-ldflags - '' - + lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) '' - echo "-lunwind" >> $out/nix-support/cc-ldflags - '' - + lib.optionalString stdenv.targetPlatform.isWasm '' - echo "-fno-exceptions" >> $out/nix-support/cc-cflags - '' - ) - + mkExtraBuildCommandsBasicRt cc; - } - // lib.optionalAttrs (lib.versionAtLeast metadata.release_version "14") { - nixSupport.cc-cflags = [ - "-rtlib=compiler-rt" - "-Wno-unused-command-line-argument" - "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" - ] - ++ lib.optional ( - !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin - ) "--unwindlib=libunwind" - ++ lib.optional ( - !stdenv.targetPlatform.isWasm - && !stdenv.targetPlatform.isFreeBSD - && stdenv.targetPlatform.useLLVM or false - ) "-lunwind" - ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; - nixSupport.cc-ldflags = lib.optionals ( - !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin - ) [ "-L${targetLlvmLibraries.libunwind}/lib" ]; - } - ); + clangWithLibcAndBasicRt = wrapCCWith rec { + cc = tools.clang-unwrapped; + libcxx = null; + bintools = bintools'; + extraPackages = [ targetLlvmLibraries.compiler-rt-no-libc ]; + extraBuildCommands = mkExtraBuildCommandsBasicRt cc; + nixSupport.cc-cflags = [ + "-rtlib=compiler-rt" + "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" + "-nostdlib++" + ] + ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; + }; - clangWithLibcAndBasicRt = wrapCCWith ( - rec { - cc = tools.clang-unwrapped; - libcxx = null; - bintools = bintools'; - extraPackages = [ targetLlvmLibraries.compiler-rt-no-libc ]; - extraBuildCommands = - lib.optionalString (lib.versions.major metadata.release_version == "13") '' - echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags - echo "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" >> $out/nix-support/cc-cflags - echo "-nostdlib++" >> $out/nix-support/cc-cflags - '' - + mkExtraBuildCommandsBasicRt cc; - } - // lib.optionalAttrs (lib.versionAtLeast metadata.release_version "14") { - nixSupport.cc-cflags = [ - "-rtlib=compiler-rt" - "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" - "-nostdlib++" - ] - ++ lib.optional ( - lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm - ) "-fno-exceptions"; - } - ); + clangNoLibcWithBasicRt = wrapCCWith rec { + cc = tools.clang-unwrapped; + libcxx = null; + bintools = bintoolsNoLibc'; + extraPackages = [ targetLlvmLibraries.compiler-rt-no-libc ]; + extraBuildCommands = mkExtraBuildCommandsBasicRt cc; + nixSupport.cc-cflags = [ + "-rtlib=compiler-rt" + "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" + ] + ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; + }; - clangNoLibcWithBasicRt = wrapCCWith ( - rec { - cc = tools.clang-unwrapped; - libcxx = null; - bintools = bintoolsNoLibc'; - extraPackages = [ targetLlvmLibraries.compiler-rt-no-libc ]; - extraBuildCommands = - lib.optionalString (lib.versions.major metadata.release_version == "13") '' - echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags - echo "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" >> $out/nix-support/cc-cflags - '' - + mkExtraBuildCommandsBasicRt cc; - } - // lib.optionalAttrs (lib.versionAtLeast metadata.release_version "14") { - nixSupport.cc-cflags = [ - "-rtlib=compiler-rt" - "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" - ] - ++ lib.optional ( - lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm - ) "-fno-exceptions"; - } - ); - - clangNoLibcNoRt = wrapCCWith ( - rec { - cc = tools.clang-unwrapped; - libcxx = null; - bintools = bintoolsNoLibc'; - extraPackages = [ ]; - # "-nostartfiles" used to be needed for pkgsLLVM, causes problems so don't include it. - extraBuildCommands = mkExtraBuildCommands0 cc; - } - // lib.optionalAttrs (lib.versionAtLeast metadata.release_version "14") { - # "-nostartfiles" used to be needed for pkgsLLVM, causes problems so don't include it. - nixSupport.cc-cflags = lib.optional ( - lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm - ) "-fno-exceptions"; - } - ); + clangNoLibcNoRt = wrapCCWith rec { + cc = tools.clang-unwrapped; + libcxx = null; + bintools = bintoolsNoLibc'; + extraPackages = [ ]; + # "-nostartfiles" used to be needed for pkgsLLVM, causes problems so don't include it. + extraBuildCommands = mkExtraBuildCommands0 cc; + nixSupport.cc-cflags = lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; + }; # This is an "oddly ordered" bootstrap just for Darwin. Probably # don't want it otherwise. @@ -457,37 +370,25 @@ let extraPackages = [ ]; extraBuildCommands = mkExtraBuildCommands0 cc; } - // lib.optionalAttrs ( - lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm - ) { nixSupport.cc-cflags = [ "-fno-exceptions" ]; }; + # FIXME: This should be inside the `wrapCCWith` call. + // lib.optionalAttrs stdenv.targetPlatform.isWasm { + nixSupport.cc-cflags = [ "-fno-exceptions" ]; + }; # Aliases clangNoCompilerRt = tools.clangNoLibcNoRt; clangNoLibc = tools.clangNoLibcWithBasicRt; clangNoLibcxx = tools.clangWithLibcAndBasicRt; - } - // lib.optionalAttrs (lib.versionAtLeast metadata.release_version "15") { - # TODO: pre-15: lldb/docs/index.rst:155:toctree contains reference to nonexisting document 'design/structureddataplugins' - lldb-manpages = lowPrio ( - tools.lldb.override { - enableManpages = true; - python3 = pkgs.python3; # don't use python-boot - } - ); - } - // lib.optionalAttrs (lib.versionAtLeast metadata.release_version "16") { + mlir = callPackage ./mlir { }; } // lib.optionalAttrs (lib.versionAtLeast metadata.release_version "19") { bolt = callPackage ./bolt { }; } - // - lib.optionalAttrs - (lib.versionAtLeast metadata.release_version "16" && lib.versionOlder metadata.release_version "22") - { - libclc = callPackage ./libclc { }; - } + // lib.optionalAttrs (lib.versionOlder metadata.release_version "22") { + libclc = callPackage ./libclc { }; + } // lib.optionalAttrs (lib.versionAtLeast metadata.release_version "20") { flang = callPackage ./flang { mlir = tools.mlir; @@ -498,14 +399,7 @@ let libraries = lib.makeExtensible ( libraries: let - callPackage = newScope ( - libraries - // buildLlvmTools - // args - // metadata - # Previously monorepoSrc was erroneously not being passed through. - // lib.optionalAttrs (lib.versionOlder metadata.release_version "14") { monorepoSrc = null; } # Preserve a bug during #307211, TODO: remove; causes llvm 13 rebuild. - ); + callPackage = newScope (libraries // buildLlvmTools // args // metadata); in ( { @@ -561,19 +455,13 @@ let libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libcxx ( - { - stdenv = - if stdenv.hostPlatform.isDarwin then - overrideCC darwin.bootstrapStdenv buildLlvmTools.clangWithLibcAndBasicRt - else - overrideCC stdenv buildLlvmTools.clangWithLibcAndBasicRt; - } - // lib.optionalAttrs (lib.versionOlder metadata.release_version "14") { - # TODO: remove this, causes LLVM 13 packages rebuild. - inherit (metadata) monorepoSrc; # Preserve bug during #307211 refactor. - } - ); + libcxx = callPackage ./libcxx { + stdenv = + if stdenv.hostPlatform.isDarwin then + overrideCC darwin.bootstrapStdenv buildLlvmTools.clangWithLibcAndBasicRt + else + overrideCC stdenv buildLlvmTools.clangWithLibcAndBasicRt; + }; libunwind = callPackage ./libunwind { stdenv = overrideCC stdenv buildLlvmTools.clangWithLibcAndBasicRt; diff --git a/pkgs/development/compilers/llvm/common/libc/default.nix b/pkgs/development/compilers/llvm/common/libc/default.nix index 1942671a782b..d5f6b0b55e39 100644 --- a/pkgs/development/compilers/llvm/common/libc/default.nix +++ b/pkgs/development/compilers/llvm/common/libc/default.nix @@ -42,8 +42,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake python3 + ninja ] - ++ (lib.optional (lib.versionAtLeast release_version "15") ninja) ++ (lib.optional isFullBuild python3Packages.pyyaml); buildInputs = lib.optional isFullBuild linuxHeaders; diff --git a/pkgs/development/compilers/llvm/common/libclc/default.nix b/pkgs/development/compilers/llvm/common/libclc/default.nix index 20e79473426d..d58602733c4b 100644 --- a/pkgs/development/compilers/llvm/common/libclc/default.nix +++ b/pkgs/development/compilers/llvm/common/libclc/default.nix @@ -30,17 +30,11 @@ stdenv.mkDerivation (finalAttrs: { pname = "libclc"; inherit version; - src = runCommand "libclc-src-${version}" { inherit (monorepoSrc) passthru; } ( - '' - mkdir -p "$out" - '' - + lib.optionalString (lib.versionAtLeast release_version "14") '' - cp -r ${monorepoSrc}/cmake "$out" - '' - + '' - cp -r ${monorepoSrc}/libclc "$out" - '' - ); + src = runCommand "libclc-src-${version}" { inherit (monorepoSrc) passthru; } ('' + mkdir -p "$out" + cp -r ${monorepoSrc}/cmake "$out" + cp -r ${monorepoSrc}/libclc "$out" + ''); sourceRoot = "${finalAttrs.src.name}/libclc"; diff --git a/pkgs/development/compilers/llvm/common/libcxx/default.nix b/pkgs/development/compilers/llvm/common/libcxx/default.nix index 520692c30d6e..b59161683842 100644 --- a/pkgs/development/compilers/llvm/common/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/common/libcxx/default.nix @@ -33,30 +33,21 @@ let # Note: useLLVM is likely false for Darwin but true under pkgsLLVM useLLVM = stdenv.hostPlatform.useLLVM or false; - cxxabiCMakeFlags = - lib.optionals (lib.versionAtLeast release_version "18") [ - (lib.cmakeBool "LIBCXXABI_USE_LLVM_UNWINDER" false) - ] - ++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm) ( - if lib.versionAtLeast release_version "18" then - [ - (lib.cmakeFeature "LIBCXXABI_ADDITIONAL_LIBRARIES" "unwind") - (lib.cmakeBool "LIBCXXABI_USE_COMPILER_RT" true) - ] - else - [ - (lib.cmakeBool "LIBCXXABI_USE_COMPILER_RT" true) - (lib.cmakeBool "LIBCXXABI_USE_LLVM_UNWINDER" true) - ] - ) - ++ lib.optionals stdenv.hostPlatform.isWasm [ - (lib.cmakeBool "LIBCXXABI_ENABLE_THREADS" false) - (lib.cmakeBool "LIBCXXABI_ENABLE_EXCEPTIONS" false) - ] - ++ lib.optionals (!enableShared || stdenv.hostPlatform.isWindows) [ - # Required on Windows due to https://github.com/llvm/llvm-project/issues/55245 - (lib.cmakeBool "LIBCXXABI_ENABLE_SHARED" false) - ]; + cxxabiCMakeFlags = [ + (lib.cmakeBool "LIBCXXABI_USE_LLVM_UNWINDER" false) + ] + ++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm) [ + (lib.cmakeFeature "LIBCXXABI_ADDITIONAL_LIBRARIES" "unwind") + (lib.cmakeBool "LIBCXXABI_USE_COMPILER_RT" true) + ] + ++ lib.optionals stdenv.hostPlatform.isWasm [ + (lib.cmakeBool "LIBCXXABI_ENABLE_THREADS" false) + (lib.cmakeBool "LIBCXXABI_ENABLE_EXCEPTIONS" false) + ] + ++ lib.optionals (!enableShared || stdenv.hostPlatform.isWindows) [ + # Required on Windows due to https://github.com/llvm/llvm-project/issues/55245 + (lib.cmakeBool "LIBCXXABI_ENABLE_SHARED" false) + ]; cxxCMakeFlags = [ (lib.cmakeFeature "LIBCXX_CXX_ABI" cxxabiName) @@ -64,8 +55,7 @@ let # https://github.com/llvm/llvm-project/issues/55245 (lib.cmakeBool "LIBCXX_ENABLE_STATIC_ABI_LIBRARY" stdenv.hostPlatform.isWindows) ] - ++ lib.optionals (cxxabi == null && lib.versionAtLeast release_version "16") [ - # Note: llvm < 16 doesn't support this flag (or it's broken); handled in postInstall instead. + ++ lib.optionals (cxxabi == null) [ # Include libc++abi symbols within libc++.a for static linking libc++; # dynamic linking includes them through libc++.so being a linker script # which includes both shared objects. @@ -78,17 +68,11 @@ let (lib.cmakeFeature "LIBCXX_HAS_MUSL_LIBC" "1") ] ++ - lib.optionals - ( - lib.versionAtLeast release_version "18" - && !useLLVM - && stdenv.hostPlatform.libc == "glibc" - && !stdenv.hostPlatform.isStatic - ) + lib.optionals (!useLLVM && stdenv.hostPlatform.libc == "glibc" && !stdenv.hostPlatform.isStatic) [ (lib.cmakeFeature "LIBCXX_ADDITIONAL_LIBRARIES" "gcc_s") ] - ++ lib.optionals (lib.versionAtLeast release_version "18" && stdenv.hostPlatform.isFreeBSD) [ + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ # Name and documentation claim this is for libc++abi, but its man effect is adding `-lunwind` # to the libc++.so linker script. We want FreeBSD's so-called libgcc instead of libunwind. (lib.cmakeBool "LIBCXXABI_USE_LLVM_UNWINDER" false) @@ -96,11 +80,9 @@ let ++ lib.optionals useLLVM [ (lib.cmakeBool "LIBCXX_USE_COMPILER_RT" true) ] - ++ - lib.optionals (useLLVM && !stdenv.hostPlatform.isFreeBSD && lib.versionAtLeast release_version "16") - [ - (lib.cmakeFeature "LIBCXX_ADDITIONAL_LIBRARIES" "unwind") - ] + ++ lib.optionals (useLLVM && !stdenv.hostPlatform.isFreeBSD) [ + (lib.cmakeFeature "LIBCXX_ADDITIONAL_LIBRARIES" "unwind") + ] ++ lib.optionals stdenv.hostPlatform.isWasm [ (lib.cmakeBool "LIBCXX_ENABLE_THREADS" false) (lib.cmakeBool "LIBCXX_ENABLE_FILESYSTEM" false) @@ -113,16 +95,8 @@ let cmakeFlags = [ (lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" (lib.concatStringsSep ";" runtimes)) ] - ++ - lib.optionals - ( - stdenv.hostPlatform.isWasm - || (lib.versions.major release_version == "12" && stdenv.hostPlatform.isDarwin) - ) - [ - (lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true) - ] ++ lib.optionals stdenv.hostPlatform.isWasm [ + (lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true) (lib.cmakeBool "CMAKE_C_COMPILER_WORKS" true) (lib.cmakeBool "UNIX" true) # Required otherwise libc++ fails to detect the correct linker ] @@ -132,171 +106,116 @@ let in -stdenv.mkDerivation ( - finalAttrs: - { - pname = "libcxx"; - inherit version cmakeFlags; +stdenv.mkDerivation (finalAttrs: { + pname = "libcxx"; + inherit version cmakeFlags; - src = - if monorepoSrc != null then - runCommand "libcxx-src-${version}" { inherit (monorepoSrc) passthru; } ( - '' - mkdir -p "$out/llvm" - '' - + (lib.optionalString (lib.versionAtLeast release_version "14") '' - cp -r ${monorepoSrc}/cmake "$out" - '') - + '' - cp -r ${monorepoSrc}/libcxx "$out" - cp -r ${monorepoSrc}/llvm/cmake "$out/llvm" - cp -r ${monorepoSrc}/llvm/utils "$out/llvm" - '' - + (lib.optionalString (lib.versionAtLeast release_version "14") '' - cp -r ${monorepoSrc}/third-party "$out" - '') - + (lib.optionalString (lib.versionAtLeast release_version "20") '' - cp -r ${monorepoSrc}/libc "$out" - '') - + '' - cp -r ${monorepoSrc}/runtimes "$out" - '' - + (lib.optionalString (cxxabi == null) '' - cp -r ${monorepoSrc}/libcxxabi "$out" - '') - ) - else - src; + src = + if monorepoSrc != null then + runCommand "libcxx-src-${version}" { inherit (monorepoSrc) passthru; } ( + '' + mkdir -p "$out/llvm" + cp -r ${monorepoSrc}/cmake "$out" + cp -r ${monorepoSrc}/libcxx "$out" + cp -r ${monorepoSrc}/llvm/cmake "$out/llvm" + cp -r ${monorepoSrc}/llvm/utils "$out/llvm" + cp -r ${monorepoSrc}/third-party "$out" + '' + + (lib.optionalString (lib.versionAtLeast release_version "20") '' + cp -r ${monorepoSrc}/libc "$out" + '') + + '' + cp -r ${monorepoSrc}/runtimes "$out" + '' + + (lib.optionalString (cxxabi == null) '' + cp -r ${monorepoSrc}/libcxxabi "$out" + '') + ) + else + src; - outputs = [ - "out" - "dev" - ]; + outputs = [ + "out" + "dev" + ]; - preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' - patchShebangs utils/cat_files.py + preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' + patchShebangs utils/cat_files.py + ''; + + # TODO: Remove on `staging`. + patches = [ ]; + + nativeBuildInputs = [ + cmake + ninja + python3 + ] + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames + ++ lib.optional (cxxabi != null) lndir; + + buildInputs = [ + cxxabi + ] + ++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm && !stdenv.hostPlatform.isFreeBSD) [ + libunwind + ]; + + # TODO: Possibly move back to `sourceRoot` on `staging`? + postPatch = '' + cd runtimes + ''; + + # libc++.so is a linker script which expands to multiple libraries, + # libc++.so.1 and libc++abi.so or the external cxxabi. ld-wrapper doesn't + # support linker scripts so the external cxxabi needs to be symlinked in + postInstall = + lib.optionalString (cxxabi != null) '' + lndir ${lib.getDev cxxabi}/include $dev/include/c++/v1 + lndir ${lib.getLib cxxabi}/lib $out/lib + libcxxabi=$out/lib/lib${cxxabi.libName}.a + '' + # LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON doesn't work for + # external cxxabi libraries so merge libc++abi.a into libc++.a ourselves. + + # GNU binutils emits objects in LIFO order in MRI scripts so after the merge + # the objects are in reversed order so a second MRI script is required so the + # objects in the archive are listed in proper order (libc++.a, libc++abi.a) + + lib.optionalString (cxxabi != null) '' + libcxxabi=''${libcxxabi-$out/lib/libc++abi.a} + if [[ -f $out/lib/libc++.a && -e $libcxxabi ]]; then + $AR -M < -Date: Sat, 9 Jul 2016 19:22:54 -0500 -Subject: [PATCH] musl fixes/hacks - -Conflicts: - - include/__config - include/locale - src/locale.cpp ---- - include/locale | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/include/locale b/include/locale -index 3d804e8..9b01f5b 100644 ---- a/include/locale -+++ b/include/locale -@@ -695,7 +695,7 @@ __num_get_signed_integral(const char* __a, const char* __a_end, - typename remove_reference::type __save_errno = errno; - errno = 0; - char *__p2; -- long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE); -+ long long __ll = strtoll(__a, &__p2, __base); - typename remove_reference::type __current_errno = errno; - if (__current_errno == 0) - errno = __save_errno; -@@ -735,7 +735,7 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end, - typename remove_reference::type __save_errno = errno; - errno = 0; - char *__p2; -- unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE); -+ unsigned long long __ll = strtoull(__a, &__p2, __base); - typename remove_reference::type __current_errno = errno; - if (__current_errno == 0) - errno = __save_errno; --- -1.7.1 - diff --git a/pkgs/development/compilers/llvm/common/libcxxabi/wasm.patch b/pkgs/development/compilers/llvm/common/libcxxabi/wasm.patch deleted file mode 100644 index 4ebfe46aa813..000000000000 --- a/pkgs/development/compilers/llvm/common/libcxxabi/wasm.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake -index 15497d405e0..33f7f18193a 100644 ---- a/cmake/modules/HandleLLVMOptions.cmake -+++ b/cmake/modules/HandleLLVMOptions.cmake -@@ -127,7 +127,10 @@ else(WIN32) - set(LLVM_HAVE_LINK_VERSION_SCRIPT 1) - endif() - else(FUCHSIA OR UNIX) -- MESSAGE(SEND_ERROR "Unable to determine platform") -+ if(${CMAKE_SYSTEM_NAME} MATCHES "Wasi") -+ else() -+ MESSAGE(SEND_ERROR "Unable to determine platform") -+ endif() - endif(FUCHSIA OR UNIX) - endif(WIN32) - diff --git a/pkgs/development/compilers/llvm/common/libunwind/default.nix b/pkgs/development/compilers/llvm/common/libunwind/default.nix index 188ba578c994..cc73f02be4e6 100644 --- a/pkgs/development/compilers/llvm/common/libunwind/default.nix +++ b/pkgs/development/compilers/llvm/common/libunwind/default.nix @@ -16,117 +16,80 @@ devExtraCmakeFlags ? [ ], getVersionFile, }: -stdenv.mkDerivation ( - finalAttrs: - let - hasPatches = builtins.length finalAttrs.patches > 0; - in - { - pname = "libunwind"; +stdenv.mkDerivation (finalAttrs: { + pname = "libunwind"; - inherit version; + inherit version; - patches = lib.optional (lib.versionOlder release_version "17") ( - getVersionFile "libunwind/gnu-install-dirs.patch" - ); + # TODO: Remove on `staging`. + patches = [ ]; - src = - if monorepoSrc != null then - runCommand "libunwind-src-${version}" { inherit (monorepoSrc) passthru; } ( - '' - mkdir -p "$out" - '' - + lib.optionalString (lib.versionAtLeast release_version "14") '' - cp -r ${monorepoSrc}/cmake "$out" - '' - + '' - cp -r ${monorepoSrc}/libunwind "$out" - mkdir -p "$out/libcxx" - cp -r ${monorepoSrc}/libcxx/cmake "$out/libcxx" - cp -r ${monorepoSrc}/libcxx/utils "$out/libcxx" - mkdir -p "$out/llvm" - cp -r ${monorepoSrc}/llvm/cmake "$out/llvm" - '' - + lib.optionalString (lib.versionAtLeast release_version "15") '' - cp -r ${monorepoSrc}/llvm/utils "$out/llvm" - cp -r ${monorepoSrc}/runtimes "$out" - '' - ) - else - src; - - sourceRoot = - if lib.versionAtLeast release_version "15" then - "${finalAttrs.src.name}/runtimes" - else - "${finalAttrs.src.name}/libunwind"; - - outputs = [ - "out" - "dev" - ]; - - nativeBuildInputs = [ - cmake - ] - ++ lib.optionals (lib.versionAtLeast release_version "15") [ - ninja - python3 - ]; - - cmakeFlags = [ - (lib.cmakeBool "LIBUNWIND_ENABLE_SHARED" enableShared) - ] - ++ lib.optional (lib.versionAtLeast release_version "15") ( - lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" "libunwind" - ) - ++ lib.optionals (lib.versions.major release_version == "12" && stdenv.hostPlatform.isDarwin) [ - (lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true) - ] - ++ devExtraCmakeFlags; - - prePatch = - lib.optionalString - (lib.versionAtLeast release_version "15" && (hasPatches || lib.versionOlder release_version "18")) - '' - cd ../libunwind - chmod -R u+w . - ''; - - postPatch = - lib.optionalString - (lib.versionAtLeast release_version "15" && (hasPatches || lib.versionOlder release_version "18")) - '' - cd ../runtimes - ''; - - postInstall = - lib.optionalString (enableShared && !stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isWindows) - '' - # libcxxabi wants to link to libunwind_shared.so (?). - ln -s $out/lib/libunwind.so $out/lib/libunwind_shared.so - '' - + lib.optionalString (enableShared && stdenv.hostPlatform.isWindows) '' - ln -s $out/lib/libunwind.dll.a $out/lib/libunwind_shared.dll.a + src = + if monorepoSrc != null then + runCommand "libunwind-src-${version}" { inherit (monorepoSrc) passthru; } '' + mkdir -p "$out" + cp -r ${monorepoSrc}/cmake "$out" + cp -r ${monorepoSrc}/libunwind "$out" + mkdir -p "$out/libcxx" + cp -r ${monorepoSrc}/libcxx/cmake "$out/libcxx" + cp -r ${monorepoSrc}/libcxx/utils "$out/libcxx" + mkdir -p "$out/llvm" + cp -r ${monorepoSrc}/llvm/cmake "$out/llvm" + cp -r ${monorepoSrc}/llvm/utils "$out/llvm" + cp -r ${monorepoSrc}/runtimes "$out" '' - + lib.optionalString (doFakeLibgcc && !stdenv.hostPlatform.isWindows) '' - ln -s $out/lib/libunwind.so $out/lib/libgcc_s.so - ln -s $out/lib/libunwind.so $out/lib/libgcc_s.so.1 - '' - + lib.optionalString (doFakeLibgcc && stdenv.hostPlatform.isWindows) '' - ln -s $out/lib/libunwind.dll.a $out/lib/libgcc_s.dll.a - ''; + else + src; - meta = llvm_meta // { - # Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst - homepage = "https://clang.llvm.org/docs/Toolchain.html#unwind-library"; - description = "LLVM's unwinder library"; - longDescription = '' - The unwind library provides a family of _Unwind_* functions implementing - the language-neutral stack unwinding portion of the Itanium C++ ABI (Level - I). It is a dependency of the C++ ABI library, and sometimes is a - dependency of other runtimes. - ''; - }; - } -) + sourceRoot = "${finalAttrs.src.name}/runtimes"; + + outputs = [ + "out" + "dev" + ]; + + nativeBuildInputs = [ + cmake + ninja + python3 + ]; + + cmakeFlags = [ + (lib.cmakeBool "LIBUNWIND_ENABLE_SHARED" enableShared) + (lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" "libunwind") + ] + ++ devExtraCmakeFlags; + + # TODO: Remove on `staging`. + prePatch = ""; + postPatch = ""; + + postInstall = + lib.optionalString (enableShared && !stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isWindows) + '' + # libcxxabi wants to link to libunwind_shared.so (?). + ln -s $out/lib/libunwind.so $out/lib/libunwind_shared.so + '' + + lib.optionalString (enableShared && stdenv.hostPlatform.isWindows) '' + ln -s $out/lib/libunwind.dll.a $out/lib/libunwind_shared.dll.a + '' + + lib.optionalString (doFakeLibgcc && !stdenv.hostPlatform.isWindows) '' + ln -s $out/lib/libunwind.so $out/lib/libgcc_s.so + ln -s $out/lib/libunwind.so $out/lib/libgcc_s.so.1 + '' + + lib.optionalString (doFakeLibgcc && stdenv.hostPlatform.isWindows) '' + ln -s $out/lib/libunwind.dll.a $out/lib/libgcc_s.dll.a + ''; + + meta = llvm_meta // { + # Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst + homepage = "https://clang.llvm.org/docs/Toolchain.html#unwind-library"; + description = "LLVM's unwinder library"; + longDescription = '' + The unwind library provides a family of _Unwind_* functions implementing + the language-neutral stack unwinding portion of the Itanium C++ ABI (Level + I). It is a dependency of the C++ ABI library, and sometimes is a + dependency of other runtimes. + ''; + }; +}) diff --git a/pkgs/development/compilers/llvm/common/lld/default.nix b/pkgs/development/compilers/llvm/common/lld/default.nix index 4681f8ce5705..13ed24cdc701 100644 --- a/pkgs/development/compilers/llvm/common/lld/default.nix +++ b/pkgs/development/compilers/llvm/common/lld/default.nix @@ -22,20 +22,14 @@ stdenv.mkDerivation (finalAttrs: { src = if monorepoSrc != null then - runCommand "lld-src-${version}" { inherit (monorepoSrc) passthru; } ( - '' - mkdir -p "$out" - '' - + lib.optionalString (lib.versionAtLeast release_version "14") '' - cp -r ${monorepoSrc}/cmake "$out" - '' - + '' - cp -r ${monorepoSrc}/lld "$out" - mkdir -p "$out/libunwind" - cp -r ${monorepoSrc}/libunwind/include "$out/libunwind" - mkdir -p "$out/llvm" - '' - ) + runCommand "lld-src-${version}" { inherit (monorepoSrc) passthru; } ('' + mkdir -p "$out" + cp -r ${monorepoSrc}/cmake "$out" + cp -r ${monorepoSrc}/lld "$out" + mkdir -p "$out/libunwind" + cp -r ${monorepoSrc}/libunwind/include "$out/libunwind" + mkdir -p "$out/llvm" + '') else src; @@ -44,12 +38,6 @@ stdenv.mkDerivation (finalAttrs: { patches = [ (getVersionFile "lld/gnu-install-dirs.patch") ] - ++ lib.optional (lib.versions.major release_version == "14") ( - getVersionFile "lld/fix-root-src-dir.patch" - ) - ++ lib.optional (lib.versionAtLeast release_version "16" && lib.versionOlder release_version "18") ( - getVersionFile "lld/add-table-base.patch" - ) ++ lib.optional (lib.versions.major release_version == "18") ( # https://github.com/llvm/llvm-project/pull/97122 fetchpatch { @@ -60,30 +48,23 @@ stdenv.mkDerivation (finalAttrs: { } ); - nativeBuildInputs = [ cmake ] ++ lib.optional (lib.versionAtLeast release_version "15") ninja; + nativeBuildInputs = [ + cmake + ninja + ]; buildInputs = [ libllvm libxml2 ]; - cmakeFlags = - lib.optionals (lib.versionOlder release_version "14") [ - (lib.cmakeFeature "LLVM_CONFIG_PATH" "${libllvm.dev}/bin/llvm-config${ - lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native" - }") - ] - ++ lib.optionals (lib.versionAtLeast release_version "15") [ - (lib.cmakeFeature "LLD_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/lld") - ] - ++ [ - (lib.cmakeFeature "LLVM_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/llvm-tblgen") - ] - ++ devExtraCmakeFlags; + cmakeFlags = [ + (lib.cmakeFeature "LLD_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/lld") + (lib.cmakeFeature "LLVM_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/llvm-tblgen") + ] + ++ devExtraCmakeFlags; - postPatch = lib.optionalString (lib.versionOlder release_version "14") '' - substituteInPlace MachO/CMakeLists.txt --replace-fail \ - '(''${LLVM_MAIN_SRC_DIR}/' '(../' - ''; + # TODO: Remove on `staging`. + postPatch = ""; # Musl's default stack size is too small for lld to be able to link Firefox. LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-Wl,-z,stack-size=2097152"; diff --git a/pkgs/development/compilers/llvm/common/lldb/default.nix b/pkgs/development/compilers/llvm/common/lldb/default.nix index c470536bc935..9fbcbb0f3839 100644 --- a/pkgs/development/compilers/llvm/common/lldb/default.nix +++ b/pkgs/development/compilers/llvm/common/lldb/default.nix @@ -32,8 +32,8 @@ let vscodeExt = { - name = if lib.versionAtLeast release_version "18" then "lldb-dap" else "lldb-vscode"; - version = if lib.versionAtLeast release_version "18" then "0.2.0" else "0.1.0"; + name = "lldb-dap"; + version = "0.2.0"; }; in @@ -49,11 +49,7 @@ stdenv.mkDerivation ( runCommand "lldb-src-${version}" { inherit (monorepoSrc) passthru; } ( '' mkdir -p "$out" - '' - + lib.optionalString (lib.versionAtLeast release_version "14") '' cp -r ${monorepoSrc}/cmake "$out" - '' - + '' cp -r ${monorepoSrc}/lldb "$out" '' + lib.optionalString (lib.versionAtLeast release_version "19" && enableManpages) '' @@ -72,64 +68,9 @@ stdenv.mkDerivation ( "dev" ]; - sourceRoot = lib.optional (lib.versionAtLeast release_version "13") "${finalAttrs.src.name}/lldb"; + sourceRoot = "${finalAttrs.src.name}/lldb"; - patches = - let - resourceDirPatch = - (replaceVars (getVersionFile "lldb/resource-dir.patch") { - clangLibDir = "${lib.getLib libclang}/lib"; - }).overrideAttrs - (_: _: { name = "resource-dir.patch"; }); - in - lib.optionals (lib.versionOlder release_version "15") [ - # Fixes for SWIG 4 - (fetchpatch2 { - url = "https://github.com/llvm/llvm-project/commit/81fc5f7909a4ef5a8d4b5da2a10f77f7cb01ba63.patch?full_index=1"; - stripLen = 1; - hash = "sha256-Znw+C0uEw7lGETQLKPBZV/Ymo2UigZS+Hv/j1mUo7p0="; - }) - (fetchpatch2 { - url = "https://github.com/llvm/llvm-project/commit/f0a25fe0b746f56295d5c02116ba28d2f965c175.patch?full_index=1"; - stripLen = 1; - hash = "sha256-QzVeZzmc99xIMiO7n//b+RNAvmxghISKQD93U2zOgFI="; - }) - ] - ++ lib.optionals (lib.versionOlder release_version "16") [ - # Fixes for SWIG 4 - (fetchpatch2 { - url = "https://github.com/llvm/llvm-project/commit/ba35c27ec9aa9807f5b4be2a0c33ca9b045accc7.patch?full_index=1"; - stripLen = 1; - hash = "sha256-LXl+WbpmWZww5xMDrle3BM2Tw56v8k9LO1f1Z1/wDTs="; - }) - (fetchpatch2 { - url = "https://github.com/llvm/llvm-project/commit/9ec115978ea2bdfc60800cd3c21264341cdc8b0a.patch?full_index=1"; - stripLen = 1; - hash = "sha256-u0zSejEjfrH3ZoMFm1j+NVv2t5AP9cE5yhsrdTS1dG4="; - }) - - # FIXME: do we need this after 15? - (getVersionFile "lldb/procfs.patch") - ] - ++ lib.optional (lib.versionOlder release_version "18") (fetchpatch { - name = "libcxx-19-char_traits.patch"; - url = "https://github.com/llvm/llvm-project/commit/68744ffbdd7daac41da274eef9ac0d191e11c16d.patch"; - stripLen = 1; - hash = "sha256-QCGhsL/mi7610ZNb5SqxjRGjwJeK2rwtsFVGeG3PUGc="; - }) - ++ lib.optionals (lib.versionOlder release_version "17") [ - resourceDirPatch - (fetchpatch { - name = "add-cstdio.patch"; - url = "https://github.com/llvm/llvm-project/commit/73e15b5edb4fa4a77e68c299a6e3b21e610d351f.patch"; - stripLen = 1; - hash = "sha256-eFcvxZaAuBsY/bda1h9212QevrXyvCHw8Cr9ngetDr0="; - }) - ] - ++ lib.optional (lib.versionOlder release_version "14") ( - getVersionFile "lldb/gnu-install-dirs.patch" - ) - ++ lib.optional (lib.versionAtLeast release_version "14") ./gnu-install-dirs.patch; + patches = [ ./gnu-install-dirs.patch ]; nativeBuildInputs = [ cmake @@ -142,14 +83,10 @@ stdenv.mkDerivation ( ] ++ lib.optionals enableManpages [ python3.pkgs.sphinx - ] - ++ lib.optionals (lib.versionOlder release_version "18" && enableManpages) [ - python3.pkgs.recommonmark - ] - ++ lib.optionals (lib.versionAtLeast release_version "18" && enableManpages) [ python3.pkgs.myst-parser ] - ++ lib.optionals (lib.versionAtLeast release_version "14") [ + # TODO: Clean up on `staging`. + ++ [ ninja ]; @@ -159,8 +96,6 @@ stdenv.mkDerivation ( libedit libxml2 libllvm - ] - ++ lib.optionals (lib.versionAtLeast release_version "16") [ # Starting with LLVM 16, the resource dir patch is no longer enough to get # libclang into the rpath of the lldb executables. By putting it into # buildInputs cc-wrapper will set up rpath correctly for us. @@ -184,24 +119,21 @@ stdenv.mkDerivation ( ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ (lib.cmakeFeature "LLDB_CODESIGN_IDENTITY" "") # codesigning makes nondeterministic ] - ++ lib.optionals (lib.versionAtLeast release_version "17") [ + # TODO: Clean up on `staging`. + ++ [ (lib.cmakeFeature "CLANG_RESOURCE_DIR" "../../../../${lib.getLib libclang}") ] - ++ lib.optionals enableManpages ( - [ - (lib.cmakeBool "LLVM_ENABLE_SPHINX" true) - (lib.cmakeBool "SPHINX_OUTPUT_MAN" true) - (lib.cmakeBool "SPHINX_OUTPUT_HTML" false) - ] - ++ lib.optionals (lib.versionAtLeast release_version "15") [ - # docs reference `automodapi` but it's not added to the extensions list when - # only building the manpages: - # https://github.com/llvm/llvm-project/blob/af6ec9200b09039573d85e349496c4f5b17c3d7f/lldb/docs/conf.py#L54 - # - # so, we just ignore the resulting errors - (lib.cmakeBool "SPHINX_WARNINGS_AS_ERRORS" false) - ] - ) + ++ lib.optionals enableManpages [ + (lib.cmakeBool "LLVM_ENABLE_SPHINX" true) + (lib.cmakeBool "SPHINX_OUTPUT_MAN" true) + (lib.cmakeBool "SPHINX_OUTPUT_HTML" false) + # docs reference `automodapi` but it's not added to the extensions list when + # only building the manpages: + # https://github.com/llvm/llvm-project/blob/af6ec9200b09039573d85e349496c4f5b17c3d7f/lldb/docs/conf.py#L54 + # + # so, we just ignore the resulting errors + (lib.cmakeBool "SPHINX_WARNINGS_AS_ERRORS" false) + ] ++ lib.optionals finalAttrs.finalPackage.doCheck [ (lib.cmakeFeature "LLDB_TEST_C_COMPILER" "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc") (lib.cmakeFeature "-DLLDB_TEST_CXX_COMPILER" "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++") @@ -209,7 +141,7 @@ stdenv.mkDerivation ( ++ devExtraCmakeFlags; doCheck = false; - doInstallCheck = lib.versionOlder release_version "15"; + doInstallCheck = false; # TODO: cleanup with mass-rebuild installCheckPhase = '' @@ -217,8 +149,6 @@ stdenv.mkDerivation ( echo "ERROR: python files not installed where expected!"; return 1; fi - '' # Something lua is built on older versions but this file doesn't exist. - + lib.optionalString (lib.versionAtLeast release_version "14") '' if [ ! -e "''${!outputLib}/lib/lua/${lua5_3.luaversion}/lldb.so" ] ; then echo "ERROR: lua files not installed where expected!"; return 1; @@ -232,9 +162,7 @@ stdenv.mkDerivation ( # vscode: install -D ../tools/${vscodeExt.name}/package.json $out/share/vscode/extensions/llvm-org.${vscodeExt.name}-${vscodeExt.version}/package.json mkdir -p $out/share/vscode/extensions/llvm-org.${vscodeExt.name}-${vscodeExt.version}/bin - ln -s $out/bin/*${ - if lib.versionAtLeast release_version "18" then vscodeExt.name else "-vscode" - } $out/share/vscode/extensions/llvm-org.${vscodeExt.name}-${vscodeExt.version}/bin + ln -s $out/bin/*${vscodeExt.name} $out/share/vscode/extensions/llvm-org.${vscodeExt.name}-${vscodeExt.version}/bin ''; passthru.vscodeExtName = vscodeExt.name; @@ -250,18 +178,16 @@ stdenv.mkDerivation ( larger LLVM Project, such as the Clang expression parser and LLVM disassembler. ''; - broken = lib.versionOlder release_version "14"; mainProgram = "lldb"; }; } // lib.optionalAttrs enableManpages { pname = "lldb-manpages"; - buildPhase = lib.optionalString (lib.versionOlder release_version "15") '' - make ${if (lib.versionOlder release_version "12") then "docs-man" else "docs-lldb-man"} - ''; + # TODO: Remove on `staging`. + buildPhase = ""; - ninjaFlags = lib.optionals (lib.versionAtLeast release_version "15") [ "docs-lldb-man" ]; + ninjaFlags = [ "docs-lldb-man" ]; propagatedBuildInputs = [ ]; diff --git a/pkgs/development/compilers/llvm/common/llvm/default.nix b/pkgs/development/compilers/llvm/common/llvm/default.nix index e7b2abfd83ed..6146c51e2d00 100644 --- a/pkgs/development/compilers/llvm/common/llvm/default.nix +++ b/pkgs/development/compilers/llvm/common/llvm/default.nix @@ -31,7 +31,7 @@ # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 # broken for the armv7l builder && !stdenv.hostPlatform.isAarch, - enablePolly ? lib.versionAtLeast release_version "14", + enablePolly ? true, enableTerminfo ? true, devExtraCmakeFlags ? [ ], getVersionFile, @@ -83,7 +83,7 @@ stdenv.mkDerivation ( pname = "llvm"; inherit version; - # Used when creating a version-suffixed symlink of libLLVM.dylib + # TODO: Remove on `staging`. shortVersion = lib.concatStringsSep "." (lib.take 1 (lib.splitString "." release_version)); src = @@ -92,8 +92,6 @@ stdenv.mkDerivation ( '' mkdir -p "$out" cp -r ${monorepoSrc}/llvm "$out" - '' - + lib.optionalString (lib.versionAtLeast release_version "14") '' cp -r ${monorepoSrc}/cmake "$out" cp -r ${monorepoSrc}/third-party "$out" '' @@ -123,29 +121,11 @@ stdenv.mkDerivation ( ]; patches = - lib.optional (lib.versionOlder release_version "14") - # When cross-compiling we configure llvm-config-native with an approximation - # of the flags used for the normal LLVM build. To avoid the need for building - # a native libLLVM.so (which would fail) we force llvm-config to be linked - # statically against the necessary LLVM components always. - ./llvm-config-link-static.patch - ++ lib.optionals (lib.versions.major release_version == "12") [ - # Fix llvm being miscompiled by some gccs. See https://github.com/llvm/llvm-project/issues/49955 - (getVersionFile "llvm/fix-llvm-issue-49955.patch") - - # On older CPUs (e.g. Hydra/wendy) we'd be getting an error in this test. - (fetchpatch { - name = "uops-CMOV16rm-noreg.diff"; - url = "https://github.com/llvm/llvm-project/commit/9e9f991ac033.diff"; - sha256 = "sha256:12s8vr6ibri8b48h2z38f3afhwam10arfiqfy4yg37bmc054p5hi"; - stripLen = 1; - }) - ] # Support custom installation dirs # Originally based off https://reviews.llvm.org/D99484 # Latest state: https://github.com/llvm/llvm-project/pull/125376 - ++ [ (getVersionFile "llvm/gnu-install-dirs.patch") ] - ++ lib.optionals (lib.versionAtLeast release_version "15") [ + [ (getVersionFile "llvm/gnu-install-dirs.patch") ] + ++ [ # Running the tests involves invoking binaries (like `opt`) that depend on # the LLVM dylibs and reference them by absolute install path (i.e. their # nix store path). @@ -188,17 +168,7 @@ stdenv.mkDerivation ( (getVersionFile "llvm/lit-shell-script-runner-set-dyld-library-path.patch") ] ++ - lib.optional (lib.versions.major release_version == "13") - # Fix random compiler crashes: https://bugs.llvm.org/show_bug.cgi?id=50611 - ( - fetchpatch { - url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/4764a4f8c920912a2bfd8b0eea57273acfe0d8a8/trunk/no-strict-aliasing-DwarfCompileUnit.patch"; - sha256 = "18l6mrvm2vmwm77ckcnbjvh6ybvn72rhrb799d4qzwac4x2ifl7g"; - stripLen = 1; - } - ) - ++ - lib.optional (lib.versionAtLeast release_version "12" && lib.versionOlder release_version "19") + lib.optional (lib.versionOlder release_version "19") # Add missing include headers to build against gcc-15: # https://github.com/llvm/llvm-project/pull/101761 ( @@ -208,58 +178,6 @@ stdenv.mkDerivation ( stripLen = 1; } ) - ++ lib.optionals (lib.versionOlder release_version "16") [ - # Fix musl build. - (fetchpatch { - url = "https://github.com/llvm/llvm-project/commit/5cd554303ead0f8891eee3cd6d25cb07f5a7bf67.patch"; - relative = "llvm"; - hash = "sha256-XPbvNJ45SzjMGlNUgt/IgEvM2dHQpDOe6woUJY+nUYA="; - }) - # Fix for Python 3.13 - (getVersionFile "llvm/no-pipes.patch") - ] - ++ lib.optionals (lib.versionOlder release_version "14") [ - # Backport gcc-13 fixes with missing includes. - (fetchpatch { - name = "signals-gcc-13.patch"; - url = "https://github.com/llvm/llvm-project/commit/ff1681ddb303223973653f7f5f3f3435b48a1983.patch"; - hash = "sha256-CXwYxQezTq5vdmc8Yn88BUAEly6YZ5VEIA6X3y5NNOs="; - stripLen = 1; - }) - (fetchpatch { - name = "base64-gcc-13.patch"; - url = "https://github.com/llvm/llvm-project/commit/5e9be93566f39ee6cecd579401e453eccfbe81e5.patch"; - hash = "sha256-PAwrVrvffPd7tphpwCkYiz+67szPRzRB2TXBvKfzQ7U="; - stripLen = 1; - }) - ] - ++ - lib.optionals - ( - (lib.versionAtLeast (lib.versions.major release_version) "14") - && (lib.versionOlder (lib.versions.major release_version) "17") - ) - [ - # fix RuntimeDyld usage on aarch64-linux (e.g. python312Packages.numba tests) - # See also: https://github.com/numba/numba/issues/9109 - (fetchpatch { - url = "https://github.com/llvm/llvm-project/commit/2e1b838a889f9793d4bcd5dbfe10db9796b77143.patch"; - relative = "llvm"; - hash = "sha256-Ot45P/iwaR4hkcM3xtLwfryQNgHI6pv6ADjv98tgdZA="; - }) - ] - ++ - lib.optional (lib.versions.major release_version == "17") - # Fixes a crash with -fzero-call-used-regs=used-gpr - # See also https://github.com/llvm/llvm-project/issues/75168 - ( - fetchpatch { - name = "fix-fzero-call-used-regs.patch"; - url = "https://github.com/llvm/llvm-project/commit/f800c1f3b207e7bcdc8b4c7192928d9a078242a0.patch"; - stripLen = 1; - hash = "sha256-e8YKrMy2rGcSJGC6er2V66cOnAnI+u1/yImkvsRsmg8="; - } - ) ++ lib.optionals (lib.versions.major release_version == "18") [ # Reorgs one test so the next patch applies (fetchpatch { @@ -277,24 +195,22 @@ stdenv.mkDerivation ( hash = "sha256-fqw5gTSEOGs3kAguR4tINFG7Xja1RAje+q67HJt2nGg="; }) ] - ++ - lib.optionals (lib.versionAtLeast release_version "17" && lib.versionOlder release_version "19") - [ - # Fixes test-suite on glibc 2.40 (https://github.com/llvm/llvm-project/pull/100804) - (fetchpatch { - url = "https://github.com/llvm/llvm-project/commit/1e8df9e85a1ff213e5868bd822877695f27504ad.patch"; - hash = "sha256-mvBlG2RxpZPFnPI7jvCMz+Fc8JuM15Ye3th1FVZMizE="; - stripLen = 1; - }) - ] + ++ lib.optionals (lib.versionOlder release_version "19") [ + # Fixes test-suite on glibc 2.40 (https://github.com/llvm/llvm-project/pull/100804) + (fetchpatch { + url = "https://github.com/llvm/llvm-project/commit/1e8df9e85a1ff213e5868bd822877695f27504ad.patch"; + hash = "sha256-mvBlG2RxpZPFnPI7jvCMz+Fc8JuM15Ye3th1FVZMizE="; + stripLen = 1; + }) + ] ++ lib.optionals enablePolly [ # Just like the `gnu-install-dirs` patch, but for `polly`. (getVersionFile "llvm/gnu-install-dirs-polly.patch") ] - ++ - lib.optional (lib.versionAtLeast release_version "15") - # Just like the `llvm-lit-cfg` patch, but for `polly`. - (getVersionFile "llvm/polly-lit-cfg-add-libs-to-dylib-path.patch") + ++ [ + # Just like the `llvm-lit-cfg` patch, but for `polly`. + (getVersionFile "llvm/polly-lit-cfg-add-libs-to-dylib-path.patch") + ] ++ lib.optional (lib.versions.major release_version == "20") # Test failure on riscv64, fixed in llvm 21 @@ -313,17 +229,12 @@ stdenv.mkDerivation ( # this is needed until scripts are updated to not use /usr/bin/uname on FreeBSD native updateAutotoolsGnuConfigScriptsHook python + ninja ] - ++ (lib.optional (lib.versionAtLeast release_version "15") ninja) ++ optionals enableManpages [ # Note: we intentionally use `python3Packages` instead of `python3.pkgs`; # splicing does *not* work with the latter. (TODO: fix) python3Packages.sphinx - ] - ++ optionals (lib.versionOlder version "18" && enableManpages) [ - python3Packages.recommonmark - ] - ++ optionals (lib.versionAtLeast version "18" && enableManpages) [ python3Packages.myst-parser ]; @@ -333,11 +244,15 @@ stdenv.mkDerivation ( ] ++ optional enablePFM libpfm; # exegesis - propagatedBuildInputs = - (lib.optional ( - lib.versionAtLeast release_version "14" || stdenv.buildPlatform == stdenv.hostPlatform - ) ncurses) - ++ [ zlib ]; + propagatedBuildInputs = [ + ncurses + zlib + ]; + + nativeCheckInputs = [ + which + ] + ++ lib.optional stdenv.hostPlatform.isDarwin sysctl; postPatch = optionalString stdenv.hostPlatform.isDarwin ( @@ -348,119 +263,90 @@ stdenv.mkDerivation ( + # As of LLVM 15, marked as XFAIL on arm64 macOS but lit doesn't seem to pick # this up: https://github.com/llvm/llvm-project/blob/c344d97a125b18f8fed0a64aace73c49a870e079/llvm/test/MC/ELF/cfi-version.ll#L7 - (optionalString (lib.versionAtLeast release_version "15") ( - '' - rm test/MC/ELF/cfi-version.ll + '' + rm test/MC/ELF/cfi-version.ll - '' - + - # This test tries to call `sw_vers` by absolute path (`/usr/bin/sw_vers`) - # and thus fails under the sandbox: - ( - if lib.versionAtLeast release_version "16" then - '' - substituteInPlace unittests/TargetParser/Host.cpp \ - --replace-fail '/usr/bin/sw_vers' "${(builtins.toString darwin.DarwinTools) + "/bin/sw_vers"}" - '' - else - '' - substituteInPlace unittests/Support/Host.cpp \ - --replace-fail '/usr/bin/sw_vers' "${(builtins.toString darwin.DarwinTools) + "/bin/sw_vers"}" - '' - ) - + - # This test tries to call the intrinsics `@llvm.roundeven.f32` and - # `@llvm.roundeven.f64` which seem to (incorrectly?) lower to `roundevenf` - # and `roundeven` on macOS and FreeBSD. - # - # However these functions are glibc specific so the test fails: - # - https://www.gnu.org/software/gnulib/manual/html_node/roundevenf.html - # - https://www.gnu.org/software/gnulib/manual/html_node/roundeven.html - # - # TODO(@rrbutani): this seems to run fine on `aarch64-darwin`, why does it - # pass there? - optionalString (lib.versionAtLeast release_version "16") '' - substituteInPlace test/ExecutionEngine/Interpreter/intrinsics.ll \ - --replace-fail "%roundeven32 = call float @llvm.roundeven.f32(float 0.000000e+00)" "" \ - --replace-fail "%roundeven64 = call double @llvm.roundeven.f64(double 0.000000e+00)" "" - '' - + - # fails when run in sandbox - optionalString (!stdenv.hostPlatform.isx86 && lib.versionAtLeast release_version "18") '' - substituteInPlace unittests/Support/VirtualFileSystemTest.cpp \ - --replace-fail "PhysicalFileSystemWorkingDirFailure" "DISABLED_PhysicalFileSystemWorkingDirFailure" - '' - )) + '' + + + # This test tries to call `sw_vers` by absolute path (`/usr/bin/sw_vers`) + # and thus fails under the sandbox: + '' + substituteInPlace unittests/TargetParser/Host.cpp \ + --replace-fail '/usr/bin/sw_vers' "${(builtins.toString darwin.DarwinTools) + "/bin/sw_vers"}" + '' + + + # This test tries to call the intrinsics `@llvm.roundeven.f32` and + # `@llvm.roundeven.f64` which seem to (incorrectly?) lower to `roundevenf` + # and `roundeven` on macOS and FreeBSD. + # + # However these functions are glibc specific so the test fails: + # - https://www.gnu.org/software/gnulib/manual/html_node/roundevenf.html + # - https://www.gnu.org/software/gnulib/manual/html_node/roundeven.html + # + # TODO(@rrbutani): this seems to run fine on `aarch64-darwin`, why does it + # pass there? + '' + substituteInPlace test/ExecutionEngine/Interpreter/intrinsics.ll \ + --replace-fail "%roundeven32 = call float @llvm.roundeven.f32(float 0.000000e+00)" "" \ + --replace-fail "%roundeven64 = call double @llvm.roundeven.f64(double 0.000000e+00)" "" + '' + + + # fails when run in sandbox + optionalString (!stdenv.hostPlatform.isx86) '' + substituteInPlace unittests/Support/VirtualFileSystemTest.cpp \ + --replace-fail "PhysicalFileSystemWorkingDirFailure" "DISABLED_PhysicalFileSystemWorkingDirFailure" + '' ) + # dup of above patch with different conditions - optionalString + optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86) ( + # fails when run in sandbox ( - stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86 && lib.versionAtLeast release_version "15" - ) - ( - optionalString (lib.versionOlder release_version "16") '' - substituteInPlace test/ExecutionEngine/Interpreter/intrinsics.ll \ - --replace-fail "%roundeven32 = call float @llvm.roundeven.f32(float 0.000000e+00)" "" \ - --replace-fail "%roundeven64 = call double @llvm.roundeven.f64(double 0.000000e+00)" "" - + '' + substituteInPlace unittests/Support/VirtualFileSystemTest.cpp \ + --replace-fail "PhysicalFileSystemWorkingDirFailure" "DISABLED_PhysicalFileSystemWorkingDirFailure" '' + - # fails when run in sandbox - ( - (optionalString (lib.versionAtLeast release_version "18") '' - substituteInPlace unittests/Support/VirtualFileSystemTest.cpp \ - --replace-fail "PhysicalFileSystemWorkingDirFailure" "DISABLED_PhysicalFileSystemWorkingDirFailure" - '') - + - # This test fails on darwin x86_64 because `sw_vers` reports a different - # macOS version than what LLVM finds by reading - # `/System/Library/CoreServices/SystemVersion.plist` (which is passed into - # the sandbox on macOS). - # - # The `sw_vers` provided by nixpkgs reports the macOS version associated - # with the `CoreFoundation` framework with which it was built. Because - # nixpkgs pins the SDK for `aarch64-darwin` and `x86_64-darwin` what - # `sw_vers` reports is not guaranteed to match the macOS version of the host - # that's building this derivation. - # - # Astute readers will note that we only _patch_ this test on aarch64-darwin - # (to use the nixpkgs provided `sw_vers`) instead of disabling it outright. - # So why does this test pass on aarch64? - # - # Well, it seems that `sw_vers` on aarch64 actually links against the _host_ - # CoreFoundation framework instead of the nixpkgs provided one. - # - # Not entirely sure what the right fix is here. I'm assuming aarch64 - # `sw_vers` doesn't intentionally link against the host `CoreFoundation` - # (still digging into how this ends up happening, will follow up) but that - # aside I think the more pertinent question is: should we be patching LLVM's - # macOS version detection logic to use `sw_vers` instead of reading host - # paths? This *is* a way in which details about builder machines can creep - # into the artifacts that are produced, affecting reproducibility, but it's - # not clear to me when/where/for what this even gets used in LLVM. - # - # TODO(@rrbutani): fix/follow-up - ( - if lib.versionAtLeast release_version "16" then - '' - substituteInPlace unittests/TargetParser/Host.cpp \ - --replace-fail "getMacOSHostVersion" "DISABLED_getMacOSHostVersion" - '' - else - '' - substituteInPlace unittests/Support/Host.cpp \ - --replace-fail "getMacOSHostVersion" "DISABLED_getMacOSHostVersion" - '' - ) - + - # This test fails with a `dysmutil` crash; have not yet dug into what's - # going on here (TODO(@rrbutani)). - lib.optionalString (lib.versionOlder release_version "19") '' - rm test/tools/dsymutil/ARM/obfuscated.test - '' - ) + # This test fails on darwin x86_64 because `sw_vers` reports a different + # macOS version than what LLVM finds by reading + # `/System/Library/CoreServices/SystemVersion.plist` (which is passed into + # the sandbox on macOS). + # + # The `sw_vers` provided by nixpkgs reports the macOS version associated + # with the `CoreFoundation` framework with which it was built. Because + # nixpkgs pins the SDK for `aarch64-darwin` and `x86_64-darwin` what + # `sw_vers` reports is not guaranteed to match the macOS version of the host + # that's building this derivation. + # + # Astute readers will note that we only _patch_ this test on aarch64-darwin + # (to use the nixpkgs provided `sw_vers`) instead of disabling it outright. + # So why does this test pass on aarch64? + # + # Well, it seems that `sw_vers` on aarch64 actually links against the _host_ + # CoreFoundation framework instead of the nixpkgs provided one. + # + # Not entirely sure what the right fix is here. I'm assuming aarch64 + # `sw_vers` doesn't intentionally link against the host `CoreFoundation` + # (still digging into how this ends up happening, will follow up) but that + # aside I think the more pertinent question is: should we be patching LLVM's + # macOS version detection logic to use `sw_vers` instead of reading host + # paths? This *is* a way in which details about builder machines can creep + # into the artifacts that are produced, affecting reproducibility, but it's + # not clear to me when/where/for what this even gets used in LLVM. + # + # TODO(@rrbutani): fix/follow-up + '' + substituteInPlace unittests/TargetParser/Host.cpp \ + --replace-fail "getMacOSHostVersion" "DISABLED_getMacOSHostVersion" + '' + + + # This test fails with a `dysmutil` crash; have not yet dug into what's + # going on here (TODO(@rrbutani)). + lib.optionalString (lib.versionOlder release_version "19") '' + rm test/tools/dsymutil/ARM/obfuscated.test + '' ) + ) + # FileSystem permissions tests fail with various special bits '' @@ -470,32 +356,14 @@ stdenv.mkDerivation ( substituteInPlace unittests/IR/CMakeLists.txt \ --replace-fail "PassBuilderCallbacksTest.cpp" "" rm unittests/IR/PassBuilderCallbacksTest.cpp + rm test/tools/llvm-objcopy/ELF/mirror-permissions-unix.test '' - + lib.optionalString (lib.versionAtLeast release_version "13") '' - rm test/tools/llvm-objcopy/ELF/mirror-permissions-unix.test - '' - + lib.optionalString (lib.versionOlder release_version "13") '' - # TODO: Fix failing tests: - rm test/DebugInfo/X86/vla-multi.ll - '' + # Fails in the presence of anti-virus software or other intrusion-detection software that # modifies the atime when run. See #284056. - lib.optionalString (lib.versionAtLeast release_version "16") ( - '' - rm test/tools/llvm-objcopy/ELF/strip-preserve-atime.test - '' - + lib.optionalString (lib.versionOlder release_version "17") '' - - '' - ) - + - # timing-based tests are trouble - lib.optionalString - (lib.versionAtLeast release_version "15" && lib.versionOlder release_version "17") - '' - rm utils/lit/tests/googletest-timeout.py - '' + '' + rm test/tools/llvm-objcopy/ELF/strip-preserve-atime.test + '' + # valgrind unhappy with musl or glibc, but fails w/musl only optionalString stdenv.hostPlatform.isMusl '' @@ -540,44 +408,7 @@ stdenv.mkDerivation ( '' + '' patchShebangs test/BugPoint/compile-custom.ll.py - '' - + - # Tweak tests to ignore namespace part of type to support - # gcc-12: https://gcc.gnu.org/PR103598. - # The change below mangles strings like: - # CHECK-NEXT: Starting llvm::Function pass manager run. - # to: - # CHECK-NEXT: Starting {{.*}}Function pass manager run. - (lib.optionalString (lib.versionOlder release_version "13") ( - '' - for f in \ - test/Other/new-pass-manager.ll \ - test/Other/new-pm-O0-defaults.ll \ - test/Other/new-pm-defaults.ll \ - test/Other/new-pm-lto-defaults.ll \ - test/Other/new-pm-thinlto-defaults.ll \ - test/Other/pass-pipeline-parsing.ll \ - test/Transforms/Inline/cgscc-incremental-invalidate.ll \ - test/Transforms/Inline/clear-analyses.ll \ - test/Transforms/LoopUnroll/unroll-loop-invalidation.ll \ - test/Transforms/SCCP/ipsccp-preserve-analysis.ll \ - test/Transforms/SCCP/preserve-analysis.ll \ - test/Transforms/SROA/dead-inst.ll \ - test/tools/gold/X86/new-pm.ll \ - ; do - echo "PATCH: $f" - substituteInPlace $f \ - --replace-quiet 'Starting llvm::' 'Starting {{.*}}' \ - --replace-quiet 'Finished llvm::' 'Finished {{.*}}' - done - '' - + - # gcc-13 fix - '' - sed -i '/#include /i#include ' \ - include/llvm/DebugInfo/Symbolize/DIPrinter.h - '' - )); + ''; # Workaround for configure flags that need to have spaces preConfigure = '' @@ -586,6 +417,40 @@ stdenv.mkDerivation ( ) ''; + # Defensive check: some paths (that we make symlinks to) depend on the release + # version, for example: + # - https://github.com/llvm/llvm-project/blob/406bde9a15136254f2b10d9ef3a42033b3cb1b16/clang/lib/Headers/CMakeLists.txt#L185 + # + # So we want to sure that the version in the source matches the release + # version we were given. + # + # We do this check here, in the LLVM build, because it happens early. + postConfigure = + let + v = lib.versions; + major = v.major release_version; + minor = v.minor release_version; + patch = v.patch release_version; + in + '' + # $1: part, $2: expected + check_version() { + part="''${1^^}" + part="$(cat include/llvm/Config/llvm-config.h | grep "#define LLVM_VERSION_''${part} " | cut -d' ' -f3)" + + if [[ "$part" != "$2" ]]; then + echo >&2 \ + "mismatch in the $1 version! we have version ${release_version}" \ + "and expected the $1 version to be '$2'; the source has '$part' instead" + exit 3 + fi + } + + check_version major ${major} + check_version minor ${minor} + check_version patch ${patch} + ''; + # E.g. Mesa uses the build-id as a cache key (see #93946): LDFLAGS = optionalString ( enableSharedLibraries && !stdenv.hostPlatform.isDarwin @@ -602,22 +467,12 @@ stdenv.mkDerivation ( # # Some flags don't need to be repassed because LLVM already does so (like # CMAKE_BUILD_TYPE), others are irrelevant to the result. - flagsForLlvmConfig = - ( - if lib.versionOlder release_version "15" then - [ - (lib.cmakeFeature "LLVM_INSTALL_CMAKE_DIR" "${placeholder "dev"}/lib/cmake/llvm/") - ] - else - [ - (lib.cmakeFeature "LLVM_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/llvm") - ] - ) - ++ [ - (lib.cmakeBool "LLVM_ENABLE_RTTI" true) - (lib.cmakeBool "LLVM_LINK_LLVM_DYLIB" enableSharedLibraries) - (lib.cmakeFeature "LLVM_TABLEGEN" "${buildLlvmTools.tblgen}/bin/llvm-tblgen") - ]; + flagsForLlvmConfig = [ + (lib.cmakeFeature "LLVM_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/llvm") + (lib.cmakeBool "LLVM_ENABLE_RTTI" true) + (lib.cmakeBool "LLVM_LINK_LLVM_DYLIB" enableSharedLibraries) + (lib.cmakeFeature "LLVM_TABLEGEN" "${buildLlvmTools.tblgen}/bin/llvm-tblgen") + ]; in flagsForLlvmConfig ++ [ @@ -707,23 +562,11 @@ stdenv.mkDerivation ( moveToOutput "bin/llvm-config*" "$dev" substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${lib.toLower finalAttrs.finalPackage.cmakeBuildType}.cmake" \ --replace-fail "$out/bin/llvm-config" "$dev/bin/llvm-config" + substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ + --replace-fail 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "'"$lib"'")' '' - + ( - if lib.versionOlder release_version "15" then - '' - substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ - --replace-fail 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}'"$lib"'")' - '' - else - '' - substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ - --replace-fail 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "'"$lib"'")' - '' - ) + optionalString (stdenv.hostPlatform.isDarwin && enableSharedLibraries) '' - ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${ - if lib.versionOlder release_version "18" then "$shortVersion" else release_version - }.dylib + ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib '' + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ( if stdenv.buildPlatform.canExecute stdenv.hostPlatform then @@ -739,7 +582,6 @@ stdenv.mkDerivation ( doCheck = !isDarwinBootstrap && !stdenv.hostPlatform.isAarch32 - && (if lib.versionOlder release_version "15" then stdenv.hostPlatform.isLinux else true) && ( !stdenv.hostPlatform.isx86_32 # TODO: why ) @@ -772,98 +614,23 @@ stdenv.mkDerivation ( ''; }; } - // lib.optionalAttrs enableManpages ( - { - pname = "llvm-manpages"; + // lib.optionalAttrs enableManpages { + pname = "llvm-manpages"; - propagatedBuildInputs = [ ]; + propagatedBuildInputs = [ ]; - postPatch = null; - postInstall = null; + ninjaFlags = [ "docs-llvm-man" ]; + installTargets = [ "install-docs-llvm-man" ]; - outputs = [ "out" ]; + doCheck = false; - doCheck = false; + postPatch = null; + postInstall = null; - meta = llvm_meta // { - description = "man pages for LLVM ${version}"; - }; - } - // ( - if lib.versionOlder release_version "15" then - { - buildPhase = '' - make docs-llvm-man - ''; + outputs = [ "out" ]; - installPhase = '' - make -C docs install - ''; - } - else - { - ninjaFlags = [ "docs-llvm-man" ]; - installTargets = [ "install-docs-llvm-man" ]; - - postPatch = null; - postInstall = null; - } - ) - ) - // lib.optionalAttrs (lib.versionAtLeast release_version "13") { - nativeCheckInputs = [ - which - ] - ++ lib.optional (stdenv.hostPlatform.isDarwin && lib.versionAtLeast release_version "15") sysctl; - } - // lib.optionalAttrs (lib.versionOlder release_version "15") { - # hacky fix: created binaries need to be run before installation - preBuild = '' - mkdir -p $out/ - ln -sv $PWD/lib $out - ''; - - postBuild = '' - rm -fR $out - ''; - - preCheck = '' - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib - ''; - } - // lib.optionalAttrs (lib.versionAtLeast release_version "15") { - # Defensive check: some paths (that we make symlinks to) depend on the release - # version, for example: - # - https://github.com/llvm/llvm-project/blob/406bde9a15136254f2b10d9ef3a42033b3cb1b16/clang/lib/Headers/CMakeLists.txt#L185 - # - # So we want to sure that the version in the source matches the release - # version we were given. - # - # We do this check here, in the LLVM build, because it happens early. - postConfigure = - let - v = lib.versions; - major = v.major release_version; - minor = v.minor release_version; - patch = v.patch release_version; - in - '' - # $1: part, $2: expected - check_version() { - part="''${1^^}" - part="$(cat include/llvm/Config/llvm-config.h | grep "#define LLVM_VERSION_''${part} " | cut -d' ' -f3)" - - if [[ "$part" != "$2" ]]; then - echo >&2 \ - "mismatch in the $1 version! we have version ${release_version}" \ - "and expected the $1 version to be '$2'; the source has '$part' instead" - exit 3 - fi - } - - check_version major ${major} - check_version minor ${minor} - check_version patch ${patch} - ''; + meta = llvm_meta // { + description = "man pages for LLVM ${version}"; + }; } ) diff --git a/pkgs/development/compilers/llvm/common/llvm/llvm-config-link-static.patch b/pkgs/development/compilers/llvm/common/llvm/llvm-config-link-static.patch deleted file mode 100644 index 3881cc5206e2..000000000000 --- a/pkgs/development/compilers/llvm/common/llvm/llvm-config-link-static.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git llvm/tools/llvm-config/CMakeLists.txt llvm/tools/llvm-config/CMakeLists.txt -index 16ba54c0cf2f..20b017195e84 100644 ---- llvm/tools/llvm-config/CMakeLists.txt -+++ llvm/tools/llvm-config/CMakeLists.txt -@@ -6,6 +6,7 @@ set(BUILDVARIABLES_OBJPATH ${CMAKE_CURRENT_BINARY_DIR}/BuildVariables.inc) - # Add the llvm-config tool. - add_llvm_tool(llvm-config - llvm-config.cpp -+ DISABLE_LLVM_LINK_LLVM_DYLIB - ) - - # Compute the substitution values for various items. diff --git a/pkgs/development/compilers/llvm/common/mlir/default.nix b/pkgs/development/compilers/llvm/common/mlir/default.nix index d0ebf9bde2c5..e6cb4a415d99 100644 --- a/pkgs/development/compilers/llvm/common/mlir/default.nix +++ b/pkgs/development/compilers/llvm/common/mlir/default.nix @@ -25,20 +25,14 @@ stdenv.mkDerivation (finalAttrs: { && (!stdenv.hostPlatform.isMusl); # Blank llvm dir just so relative path works - src = runCommand "${finalAttrs.pname}-src-${version}" { inherit (monorepoSrc) passthru; } ( - '' - mkdir -p "$out" - '' - + lib.optionalString (lib.versionAtLeast release_version "14") '' - cp -r ${monorepoSrc}/cmake "$out" - '' - + '' - cp -r ${monorepoSrc}/mlir "$out" - cp -r ${monorepoSrc}/third-party "$out/third-party" + src = runCommand "${finalAttrs.pname}-src-${version}" { inherit (monorepoSrc) passthru; } ('' + mkdir -p "$out" + cp -r ${monorepoSrc}/cmake "$out" + cp -r ${monorepoSrc}/mlir "$out" + cp -r ${monorepoSrc}/third-party "$out/third-party" - mkdir -p "$out/llvm" - '' - ); + mkdir -p "$out/llvm" + ''); sourceRoot = "${finalAttrs.src.name}/mlir"; diff --git a/pkgs/development/compilers/llvm/common/openmp/default.nix b/pkgs/development/compilers/llvm/common/openmp/default.nix index d480b33a6025..ad4b485085ff 100644 --- a/pkgs/development/compilers/llvm/common/openmp/default.nix +++ b/pkgs/development/compilers/llvm/common/openmp/default.nix @@ -25,114 +25,87 @@ assert lib.assertMsg (ompdGdbSupport -> ompdSupport) "OMPD GDB support requires OMPD support!"; -stdenv.mkDerivation ( - finalAttrs: - { - pname = "openmp"; - inherit version; +stdenv.mkDerivation (finalAttrs: { + pname = "openmp"; + inherit version; - src = - if monorepoSrc != null then - runCommand "openmp-src-${version}" { inherit (monorepoSrc) passthru; } ( - '' - mkdir -p "$out" - '' - + lib.optionalString (lib.versionAtLeast release_version "14") '' - cp -r ${monorepoSrc}/cmake "$out" - '' - + '' - cp -r ${monorepoSrc}/openmp "$out" - '' - ) - else - src; + src = + if monorepoSrc != null then + runCommand "openmp-src-${version}" { inherit (monorepoSrc) passthru; } ('' + mkdir -p "$out" + cp -r ${monorepoSrc}/cmake "$out" + cp -r ${monorepoSrc}/openmp "$out" + '') + else + src; - sourceRoot = "${finalAttrs.src.name}/openmp"; + sourceRoot = "${finalAttrs.src.name}/openmp"; - outputs = [ "out" ] ++ lib.optionals (lib.versionAtLeast release_version "14") [ "dev" ]; + outputs = [ + "out" + "dev" + ]; - patchFlags = if lib.versionOlder release_version "14" then [ "-p2" ] else null; + # TODO: Remove on `staging`. + patchFlags = null; - patches = - lib.optional (lib.versionAtLeast release_version "15" && lib.versionOlder release_version "19") ( - getVersionFile "openmp/fix-find-tool.patch" - ) - ++ lib.optional (lib.versionAtLeast release_version "14" && lib.versionOlder release_version "18") ( - getVersionFile "openmp/gnu-install-dirs.patch" - ) - ++ lib.optional (lib.versionAtLeast release_version "14") ( - getVersionFile "openmp/run-lit-directly.patch" - ) - ++ - lib.optional (lib.versionOlder release_version "14") - # Fix cross. - ( - fetchpatch { - url = "https://github.com/llvm/llvm-project/commit/5e2358c781b85a18d1463fd924d2741d4ae5e42e.patch"; - hash = "sha256-UxIlAifXnexF/MaraPW0Ut6q+sf3e7y1fMdEv1q103A="; - } - ); - - nativeBuildInputs = [ - cmake - python3.pythonOnBuildForHost - perl - ] - ++ lib.optionals (lib.versionAtLeast release_version "15") [ - ninja - ] - ++ lib.optionals (lib.versionAtLeast release_version "14") [ - pkg-config - lit + patches = + lib.optional (lib.versionOlder release_version "19") (getVersionFile "openmp/fix-find-tool.patch") + ++ [ + (getVersionFile "openmp/run-lit-directly.patch") ]; - buildInputs = [ - (if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm) - ] - ++ lib.optionals (ompdSupport && ompdGdbSupport) [ - python3 - ]; + nativeBuildInputs = [ + cmake + python3.pythonOnBuildForHost + perl + ninja + pkg-config + lit + ]; - cmakeFlags = [ - (lib.cmakeBool "LIBOMP_ENABLE_SHARED" ( - !stdenv.hostPlatform.isStatic && stdenv.hostPlatform.hasSharedLibraries - )) - (lib.cmakeBool "LIBOMP_OMPD_SUPPORT" ompdSupport) - (lib.cmakeBool "LIBOMP_OMPD_GDB_SUPPORT" ompdGdbSupport) - ] - ++ lib.optionals (lib.versions.major release_version == "13") [ - (lib.cmakeBool "LIBOMPTARGET_BUILD_AMDGCN_BCLIB" false) # Building the AMDGCN device RTL fails - ] - ++ lib.optionals (lib.versionAtLeast release_version "14") [ - (lib.cmakeFeature "CLANG_TOOL" "${clang-unwrapped}/bin/clang") - (lib.cmakeFeature "OPT_TOOL" "${llvm}/bin/opt") - (lib.cmakeFeature "LINK_TOOL" "${llvm}/bin/llvm-link") - ] - ++ devExtraCmakeFlags; + buildInputs = [ + (if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm) + ] + ++ lib.optionals (ompdSupport && ompdGdbSupport) [ + python3 + ]; - meta = llvm_meta // { - homepage = "https://openmp.llvm.org/"; - description = "Support for the OpenMP language"; - longDescription = '' - The OpenMP subproject of LLVM contains the components required to build an - executable OpenMP program that are outside the compiler itself. - Contains the code for the runtime library against which code compiled by - "clang -fopenmp" must be linked before it can run and the library that - supports offload to target devices. - ''; - # "All of the code is dual licensed under the MIT license and the UIUC - # License (a BSD-like license)": - license = with lib.licenses; [ - mit - ncsa - ]; - }; - } - // (lib.optionalAttrs (lib.versionAtLeast release_version "14") { - doCheck = false; - checkTarget = "check-openmp"; - preCheck = '' - patchShebangs ../tools/archer/tests/deflake.bash + cmakeFlags = [ + (lib.cmakeBool "LIBOMP_ENABLE_SHARED" ( + !stdenv.hostPlatform.isStatic && stdenv.hostPlatform.hasSharedLibraries + )) + (lib.cmakeBool "LIBOMP_OMPD_SUPPORT" ompdSupport) + (lib.cmakeBool "LIBOMP_OMPD_GDB_SUPPORT" ompdGdbSupport) + (lib.cmakeFeature "CLANG_TOOL" "${clang-unwrapped}/bin/clang") + (lib.cmakeFeature "OPT_TOOL" "${llvm}/bin/opt") + (lib.cmakeFeature "LINK_TOOL" "${llvm}/bin/llvm-link") + ] + ++ devExtraCmakeFlags; + + doCheck = false; + + checkTarget = "check-openmp"; + + preCheck = '' + patchShebangs ../tools/archer/tests/deflake.bash + ''; + + meta = llvm_meta // { + homepage = "https://openmp.llvm.org/"; + description = "Support for the OpenMP language"; + longDescription = '' + The OpenMP subproject of LLVM contains the components required to build an + executable OpenMP program that are outside the compiler itself. + Contains the code for the runtime library against which code compiled by + "clang -fopenmp" must be linked before it can run and the library that + supports offload to target devices. ''; - }) -) + # "All of the code is dual licensed under the MIT license and the UIUC + # License (a BSD-like license)": + license = with lib.licenses; [ + mit + ncsa + ]; + }; +}) diff --git a/pkgs/development/compilers/llvm/common/patches.nix b/pkgs/development/compilers/llvm/common/patches.nix index 21eb8c4471c3..75a3659228e8 100644 --- a/pkgs/development/compilers/llvm/common/patches.nix +++ b/pkgs/development/compilers/llvm/common/patches.nix @@ -1,9 +1,5 @@ { "clang/gnu-install-dirs.patch" = [ - { - before = "14"; - path = ../12; - } { after = "19"; path = ../19; @@ -11,41 +7,13 @@ ]; "clang/purity.patch" = [ { - after = "18"; path = ../18; } - { - before = "17"; - after = "15"; - path = ../15; - } - { - before = "16"; - path = ../12; - } - ]; - "clang/aarch64-tblgen.patch" = [ - { - after = "17"; - before = "18"; - path = ../17; - } - ]; - "lld/add-table-base.patch" = [ - { - after = "16"; - path = ../16; - } ]; "lld/gnu-install-dirs.patch" = [ { - after = "18"; path = ../18; } - { - before = "14"; - path = ../12; - } ]; "llvm/gnu-install-dirs.patch" = [ { @@ -63,7 +31,6 @@ path = ../20; } { - after = "18"; before = "20"; path = ../18; } @@ -75,58 +42,27 @@ } { before = "20"; - after = "18"; path = ../18; } - { - before = "18"; - after = "14"; - path = ../14; - } ]; "llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch" = [ { - before = "17"; - after = "15"; - path = ../15; - } - { - after = "17"; - path = ../17; + path = ../18; } ]; "llvm/lit-shell-script-runner-set-dyld-library-path.patch" = [ { - after = "18"; path = ../18; } - { - after = "16"; - before = "18"; - path = ../16; - } ]; "llvm/polly-lit-cfg-add-libs-to-dylib-path.patch" = [ { - after = "15"; - path = ../15; - } - ]; - "libunwind/gnu-install-dirs.patch" = [ - { - before = "17"; - after = "15"; - path = ../15; + path = ../18; } ]; "compiler-rt/X86-support-extension.patch" = [ { - after = "15"; - path = ../15; - } - { - before = "15"; - path = ../12; + path = ../18; } ]; "compiler-rt/armv6-scudo-libatomic.patch" = [ @@ -135,102 +71,24 @@ path = ../19; } { - after = "15"; before = "19"; - path = ../15; - } - { - before = "15"; - path = ../14; - } - ]; - "compiler-rt/armv7l.patch" = [ - { - before = "15"; - after = "13"; - path = ../13; - } - ]; - "compiler-rt/gnu-install-dirs.patch" = [ - { - before = "14"; - path = ../12; - } - { - after = "13"; - before = "15"; - path = ../14; - } - { - after = "15"; - before = "17"; - path = ../15; - } - { - after = "16"; - path = ../17; - } - ]; - "compiler-rt/darwin-targetconditionals.patch" = [ - { - after = "13"; - path = ../13; - } - ]; - "compiler-rt/codesign.patch" = [ - { - after = "13"; - path = ../13; + path = ../18; } ]; "compiler-rt/normalize-var.patch" = [ { - after = "16"; - path = ../16; - } - { - before = "16"; - path = ../12; - } - ]; - "lldb/procfs.patch" = [ - { - after = "15"; - path = ../15; - } - { - before = "15"; - path = ../12; - } - ]; - "lldb/resource-dir.patch" = [ - { - before = "16"; - path = ../12; - } - ]; - "llvm/no-pipes.patch" = [ - { - before = "16"; - path = ../12; + path = ../18; } ]; "openmp/fix-find-tool.patch" = [ { - after = "17"; before = "19"; - path = ../17; + path = ../18; } ]; "openmp/run-lit-directly.patch" = [ { - after = "16"; - path = ../16; - } - { - after = "14"; - before = "16"; - path = ../14; + path = ../18; } ]; "libclc/use-default-paths.patch" = [ @@ -246,9 +104,8 @@ ]; "libclc/gnu-install-dirs.patch" = [ { - after = "16"; before = "21"; - path = ../16; + path = ../18; } { after = "21"; diff --git a/pkgs/development/compilers/llvm/common/tblgen.nix b/pkgs/development/compilers/llvm/common/tblgen.nix index 33409745e0d4..0fa2f6269d6d 100644 --- a/pkgs/development/compilers/llvm/common/tblgen.nix +++ b/pkgs/development/compilers/llvm/common/tblgen.nix @@ -38,21 +38,15 @@ let src' = if monorepoSrc != null then - runCommand "${pname}-src-${version}" { } ( - '' - mkdir -p "$out" - '' - + lib.optionalString (lib.versionAtLeast release_version "14") '' - cp -r ${monorepoSrc}/cmake "$out" - cp -r ${monorepoSrc}/third-party "$out" - '' - + '' - cp -r ${monorepoSrc}/llvm "$out" - cp -r ${monorepoSrc}/clang "$out" - cp -r ${monorepoSrc}/clang-tools-extra "$out" - cp -r ${monorepoSrc}/mlir "$out" - '' - ) + runCommand "${pname}-src-${version}" { } ('' + mkdir -p "$out" + cp -r ${monorepoSrc}/cmake "$out" + cp -r ${monorepoSrc}/third-party "$out" + cp -r ${monorepoSrc}/llvm "$out" + cp -r ${monorepoSrc}/clang "$out" + cp -r ${monorepoSrc}/clang-tools-extra "$out" + cp -r ${monorepoSrc}/mlir "$out" + '') else src; @@ -60,18 +54,12 @@ let targets = [ "clang-tblgen" "llvm-tblgen" - ] - ++ lib.optionals (lib.versionAtLeast release_version "15") [ "clang-tidy-confusable-chars-gen" - ] - ++ lib.optionals (lib.versionAtLeast release_version "16") [ "mlir-tblgen" ] - ++ - lib.optionals ((lib.versionAtLeast release_version "15") && (lib.versionOlder release_version "20")) - [ - "clang-pseudo-gen" # Removed in LLVM 20 @ ed8f78827895050442f544edef2933a60d4a7935. - ]; + ++ lib.optionals (lib.versionOlder release_version "20") [ + "clang-pseudo-gen" # Removed in LLVM 20 @ ed8f78827895050442f544edef2933a60d4a7935. + ]; self = stdenv.mkDerivation (finalAttrs: { inherit pname version patches; @@ -105,16 +93,12 @@ let cmakeFlags = [ # Projects with tablegen-like tools. "-DLLVM_ENABLE_PROJECTS=${ - lib.concatStringsSep ";" ( - [ - "llvm" - "clang" - "clang-tools-extra" - ] - ++ lib.optionals (lib.versionAtLeast release_version "16") [ - "mlir" - ] - ) + lib.concatStringsSep ";" [ + "llvm" + "clang" + "clang-tools-extra" + "mlir" + ] }" ] ++ devExtraCmakeFlags; diff --git a/pkgs/development/compilers/llvm/default.nix b/pkgs/development/compilers/llvm/default.nix index f5b86b1c3312..68935a64f30b 100644 --- a/pkgs/development/compilers/llvm/default.nix +++ b/pkgs/development/compilers/llvm/default.nix @@ -22,12 +22,6 @@ }@packageSetArgs: let versions = { - "12.0.1".officialRelease.sha256 = "08s5w2db9imb2yaqsvxs6pg21csi1cf6wa35rf8x6q07mam7j8qv"; - "13.0.1".officialRelease.sha256 = "06dv6h5dmvzdxbif2s8njki6h32796v368dyb5945x8gjj72xh7k"; - "14.0.6".officialRelease.sha256 = "sha256-vffu4HilvYwtzwgq+NlS26m65DGbp6OSSne2aje1yJE="; - "15.0.7".officialRelease.sha256 = "sha256-wjuZQyXQ/jsmvy6y1aksCcEDXGBjuhpgngF3XQJ/T4s="; - "16.0.6".officialRelease.sha256 = "sha256-fspqSReX+VD+Nl/Cfq+tDcdPtnQPV1IRopNDfd5VtUs="; - "17.0.6".officialRelease.sha256 = "sha256-8MEDLLhocshmxoEBRSKlJ/GzJ8nfuzQ8qn0X/vLA+ag="; "18.1.8".officialRelease.sha256 = "sha256-iiZKMRo/WxJaBXct9GdAcAT3cz9d9pnAcO1mmR6oPNE="; "19.1.7".officialRelease.sha256 = "sha256-cZAB5vZjeTsXt9QHbP5xluWNQnAHByHtHnAhVDV0E6I="; "20.1.8".officialRelease.sha256 = "sha256-ysyB/EYxi2qE9fD5x/F2zI4vjn8UDoo1Z9ukiIrjFGw="; diff --git a/pkgs/development/compilers/llvm/update.sh b/pkgs/development/compilers/llvm/update.sh index 95ad356dbd9a..b84bbc508a6a 100755 --- a/pkgs/development/compilers/llvm/update.sh +++ b/pkgs/development/compilers/llvm/update.sh @@ -20,36 +20,10 @@ sed -Ei \ readonly ATTRSET="llvmPackages_$VERSION_MAJOR" -if [ "$VERSION_MAJOR" -ge "14" ]; then - readonly SOURCES=( - "llvm.monorepoSrc" - ) -elif [ "$VERSION_MAJOR" -eq "13" ]; then - readonly SOURCES=( - "llvm.src" - ) -else - readonly SOURCES=( - "clang-unwrapped.src" - "compiler-rt.src" - "clang-unwrapped.clang-tools-extra_src" - "libcxx.src" - "libcxxabi.src" - "libunwind.src" - "lld.src" - "lldb.src" - "llvm.src" - "llvm.polly_src" - "openmp.src" - ) -fi - -for SOURCE in "${SOURCES[@]}"; do - echo "Updating the hash of $SOURCE:" - declare ATTR="$ATTRSET.$SOURCE" - declare OLD_HASH="$(nix --extra-experimental-features nix-command eval -f . $ATTR.outputHash)" - declare NEW_HASH="\"$(nix-prefetch-url -A $ATTR)\"" - find "$DIR" -type f -exec sed -i "s/$OLD_HASH/$NEW_HASH/" {} + -done +echo "Updating the hash of llvm.monorepoSrc:" +declare ATTR="$ATTRSET.llvm.monorepoSrc" +declare OLD_HASH="$(nix --extra-experimental-features nix-command eval -f . $ATTR.outputHash)" +declare NEW_HASH="\"$(nix-prefetch-url -A $ATTR)\"" +find "$DIR" -type f -exec sed -i "s/$OLD_HASH/$NEW_HASH/" {} + echo OK diff --git a/pkgs/development/compilers/mrustc/bootstrap.nix b/pkgs/development/compilers/mrustc/bootstrap.nix index c95687257749..51a772ad5f41 100644 --- a/pkgs/development/compilers/mrustc/bootstrap.nix +++ b/pkgs/development/compilers/mrustc/bootstrap.nix @@ -4,7 +4,7 @@ fetchurl, mrustc, mrustc-minicargo, - llvm_12, + #llvm_12, libffi, cmake, perl, @@ -64,7 +64,7 @@ stdenv.mkDerivation rec { ]; buildInputs = [ # for rustc - llvm_12 + #llvm_12 libffi zlib libxml2 @@ -76,7 +76,7 @@ stdenv.mkDerivation rec { # Use shared mrustc/minicargo/llvm instead of rebuilding them "MRUSTC=${mrustc}/bin/mrustc" #"MINICARGO=${mrustc-minicargo}/bin/minicargo" # FIXME: we need to rebuild minicargo locally so --manifest-overrides is applied - "LLVM_CONFIG=${llvm_12.dev}/bin/llvm-config" + #"LLVM_CONFIG=${llvm_12.dev}/bin/llvm-config" "RUSTC_TARGET=${stdenv.targetPlatform.rust.rustcTarget}" ]; @@ -153,5 +153,24 @@ stdenv.mkDerivation rec { asl20 ]; platforms = [ "x86_64-linux" ]; + # rustc 1.54 only supports LLVM 12, which was removed from Nixpkgs. + # mrustc can bootstrap up to rustc 1.74, which supported LLVM 17, + # which has also been removed. + # + # 1.74 also shipped with the Cranelift backend, so perhaps that + # could be used instead? Alternatively, it may be possible to + # backport the upstream patches to support LLVM 18 to 1.74. + # Assuming LLVM 18 is still in Nixpkgs by the time you read this + # comment, anyway. But if not, then maybe mrustc has been updated + # to support newer rustc versions? Hope springs eternal. + # + # (Note that you still have to “draw the rest of the owl” to + # bootstrap the chain of rustc versions between this bootstrap + # and the version currently used in Nixpkgs, anyway, so this was + # already not useful for bootstrapping a Rust compiler for use with + # Nixpkgs without a lot of additional work. See Guix’s Rust + # bootstrap chain, or the non‐Rust minimal bootstrap in Guix and + # Nixpkgs, for inspiration.) + broken = true; }; } diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix index 20b9a0803d3e..aba7c109a6b3 100644 --- a/pkgs/development/haskell-modules/with-packages-wrapper.nix +++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix @@ -182,7 +182,7 @@ else + postBuild; preferLocalBuild = true; passthru = { - inherit (ghc) version meta targetPrefix; + inherit (ghc) version targetPrefix; hoogle = hoogleWithPackages'; @@ -203,4 +203,9 @@ else Also note that withLLVM has been renamed to useLLVM for consistency with the GHC Nix expressions.''; }; + pos = __curPos; + meta = ghc.meta // { + # To be fixed by . + broken = useLLVM; + }; } diff --git a/pkgs/development/libraries/quarto/default.nix b/pkgs/development/libraries/quarto/default.nix index cc79e821bd78..e9474573fa6f 100644 --- a/pkgs/development/libraries/quarto/default.nix +++ b/pkgs/development/libraries/quarto/default.nix @@ -96,7 +96,7 @@ stdenv.mkDerivation (final: { ''; }; - meta = with lib; { + meta = { description = "Open-source scientific and technical publishing system built on Pandoc"; mainProgram = "quarto"; longDescription = '' @@ -104,14 +104,14 @@ stdenv.mkDerivation (final: { Quarto documents are authored using markdown, an easy to write plain text format. ''; homepage = "https://quarto.org/"; - changelog = "https://github.com/quarto-dev/quarto-cli/releases/tag/v${version}"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ + changelog = "https://github.com/quarto-dev/quarto-cli/releases/tag/v${final.version}"; + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ minijackson mrtarantoga ]; - platforms = platforms.all; - sourceProvenance = with sourceTypes; [ + platforms = lib.platforms.all; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode binaryBytecode ]; diff --git a/pkgs/development/python-modules/doubles/default.nix b/pkgs/development/python-modules/doubles/default.nix new file mode 100644 index 000000000000..09f2e2d7533b --- /dev/null +++ b/pkgs/development/python-modules/doubles/default.nix @@ -0,0 +1,65 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pytest7CheckHook, + setuptools, + coverage, + six, +}: + +buildPythonPackage rec { + pname = "doubles"; + version = "1.5.3"; + pyproject = true; + + src = fetchFromGitHub { + owner = "uber"; + repo = "doubles"; + tag = "v${version}"; + hash = "sha256-7yygZ00H2eIGuI/E0dh0j30hicJKBhCqyagY6XAJTCA="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + coverage + six + ]; + + nativeCheckInputs = [ + pytest7CheckHook + ]; + + # To avoid a ValueError: Plugin already registered under a different name: + # doubles.pytest_plugin + pytestFlags = [ + "-p" + "no:doubles" + ]; + + disabledTestPaths = [ + # nose is deprecated + "test/nose_test.py" + + # These tests fail due to an incompatibility between the doubles pytest plugin + # and modern pytest versions (7+). The plugin's verification hook incorrectly + # raises a generic `AssertionError` during teardown, instead of the specific + # exceptions the negative test cases are designed to catch. + "test/allow_test.py" + "test/expect_test.py" + "test/class_double_test.py" + "test/object_double_test.py" + ]; + + pythonImportsCheck = [ "doubles" ]; + + meta = { + description = "Test doubles for Python"; + homepage = "https://github.com/uber/doubles"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ b-rodrigues ]; + }; +} diff --git a/pkgs/development/python-modules/flask/default.nix b/pkgs/development/python-modules/flask/default.nix index 75e72fd18d4f..fb57596f1f97 100644 --- a/pkgs/development/python-modules/flask/default.nix +++ b/pkgs/development/python-modules/flask/default.nix @@ -20,7 +20,6 @@ python-dotenv, # tests - greenlet, pytestCheckHook, # reverse dependencies @@ -67,9 +66,9 @@ buildPythonPackage rec { ; }; - meta = with lib; { - changelog = "https://flask.palletsprojects.com/en/${versions.majorMinor version}.x/changes/#version-${ - replaceStrings [ "." ] [ "-" ] version + meta = { + changelog = "https://flask.palletsprojects.com/en/stable/changes/#version-${ + lib.replaceStrings [ "." ] [ "-" ] version }"; homepage = "https://flask.palletsprojects.com/"; description = "Python micro framework for building web applications"; @@ -81,7 +80,7 @@ buildPythonPackage rec { around Werkzeug and Jinja and has become one of the most popular Python web application frameworks. ''; - license = licenses.bsd3; - maintainers = with maintainers; [ nickcao ]; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ nickcao ]; }; } diff --git a/pkgs/development/python-modules/hydra-joblib-launcher/default.nix b/pkgs/development/python-modules/hydra-joblib-launcher/default.nix new file mode 100644 index 000000000000..a110ecec96f0 --- /dev/null +++ b/pkgs/development/python-modules/hydra-joblib-launcher/default.nix @@ -0,0 +1,55 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + hydra-core, + joblib, + + # test + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "hydra-joblib-launcher"; + pyproject = true; + + inherit (hydra-core) version src; + + sourceRoot = "${src.name}/plugins/hydra_joblib_launcher"; + + # get rid of deprecated "read_version" dependency, no longer in Nixpkgs: + postPatch = '' + substituteInPlace pyproject.toml --replace-fail ', "read-version"' "" + substituteInPlace setup.py \ + --replace-fail 'from read_version import read_version' "" \ + --replace-fail 'version=read_version("hydra_plugins/hydra_joblib_launcher", "__init__.py"),' 'version="${version}",' + ''; + + build-system = [ + setuptools + ]; + + dependencies = [ + hydra-core + joblib + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + # tries to write to source directory otherwise: + pytestFlagsArray = [ "-p no:cacheprovider" ]; + + meta = { + inherit (hydra-core.meta) changelog license; + description = "Hydra launcher supporting parallel execution based on Joblib.Parallel"; + homepage = "https://hydra.cc/docs/plugins/joblib_launcher"; + maintainers = with lib.maintainers; [ bcdarwin ]; + }; +} diff --git a/pkgs/development/python-modules/motmetrics/default.nix b/pkgs/development/python-modules/motmetrics/default.nix index b29ed9b00602..cfec99005e8f 100644 --- a/pkgs/development/python-modules/motmetrics/default.nix +++ b/pkgs/development/python-modules/motmetrics/default.nix @@ -17,9 +17,12 @@ pytest-benchmark, }: +let + version = "1.4.0"; +in buildPythonPackage { pname = "motmetrics"; - version = "1.4.0-unstable-2025-01-14"; + version = "${version}-unstable-2025-01-14"; pyproject = true; src = fetchFromGitHub { @@ -48,11 +51,11 @@ buildPythonPackage { pythonImportsCheck = [ "motmetrics" ]; - meta = with lib; { + meta = { description = "Benchmark multiple object trackers (MOT) in Python"; homepage = "https://github.com/cheind/py-motmetrics"; - changelog = "https://github.com/cheind/py-motmetrics/releases/tag/${version}"; - license = licenses.mit; + changelog = "https://github.com/cheind/py-motmetrics/releases/tag/v${version}"; + license = lib.licenses.mit; maintainers = [ ]; }; } diff --git a/pkgs/development/python-modules/moyopy/default.nix b/pkgs/development/python-modules/moyopy/default.nix index 34cf7e73d9c0..214133cef314 100644 --- a/pkgs/development/python-modules/moyopy/default.nix +++ b/pkgs/development/python-modules/moyopy/default.nix @@ -16,14 +16,14 @@ buildPythonPackage rec { pname = "moyopy"; - version = "0.4.4"; + version = "0.4.6"; pyproject = true; src = fetchFromGitHub { owner = "spglib"; repo = "moyo"; tag = "v${version}"; - hash = "sha256-TWZAqvtPeJqKXUFiNxD8H/aqjiDSWaTkMEQW0cuhEMY="; + hash = "sha256-LMmPWE9XMj/DpsE2B9gZTqol/pG8a+RRYsLltBI/Kgc="; }; sourceRoot = "${src.name}/moyopy"; @@ -46,7 +46,7 @@ buildPythonPackage rec { sourceRoot cargoRoot ; - hash = "sha256-L4SAX4HWx+TSPQm7K6C5IEpFkx/AlscmKRs2wPEQun4="; + hash = "sha256-A0rKr2Mn9cRiLO8UwnjhdDFSr4JpXQ2RNnASkpw/Rfg="; }; build-system = [ diff --git a/pkgs/development/python-modules/scikit-learn/default.nix b/pkgs/development/python-modules/scikit-learn/default.nix index 9ebbffd136c2..1aae2aafb6f9 100644 --- a/pkgs/development/python-modules/scikit-learn/default.nix +++ b/pkgs/development/python-modules/scikit-learn/default.nix @@ -123,17 +123,17 @@ buildPythonPackage rec { pythonImportsCheck = [ "sklearn" ]; - meta = with lib; { + meta = { description = "Set of python modules for machine learning and data mining"; changelog = let - major = versions.major version; - minor = versions.minor version; - dashVer = replaceStrings [ "." ] [ "-" ] version; + major = lib.versions.major version; + minor = lib.versions.minor version; + dashVer = lib.replaceStrings [ "." ] [ "-" ] version; in "https://scikit-learn.org/stable/whats_new/v${major}.${minor}.html#version-${dashVer}"; homepage = "https://scikit-learn.org"; - license = licenses.bsd3; - maintainers = with maintainers; [ davhau ]; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ davhau ]; }; } diff --git a/pkgs/development/python-modules/sphinx-version-warning/default.nix b/pkgs/development/python-modules/sphinx-version-warning/default.nix index f7f2863a3310..faa4c72d6287 100644 --- a/pkgs/development/python-modules/sphinx-version-warning/default.nix +++ b/pkgs/development/python-modules/sphinx-version-warning/default.nix @@ -3,7 +3,6 @@ buildPythonPackage, fetchFromGitHub, fetchpatch, - pythonOlder, setuptools, sphinx, sphinx-autoapi, @@ -22,8 +21,6 @@ buildPythonPackage { version = "unstable-2019-08-10"; pyproject = true; - disabled = pythonOlder "3.7"; - outputs = [ "out" "doc" @@ -63,11 +60,11 @@ buildPythonPackage { pythonImportsCheck = [ "versionwarning" ]; - meta = with lib; { + meta = { description = "Sphinx extension to show a warning banner at the top of your documentation"; homepage = "https://github.com/humitos/sphinx-version-warning"; - changelog = "https://github.com/humitos/sphinx-version-warning/blob/${version}/CHANGELOG.rst"; - license = licenses.mit; - maintainers = with maintainers; [ kaction ]; + changelog = "https://github.com/humitos/sphinx-version-warning/blob/master/CHANGELOG.rst"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ kaction ]; }; } diff --git a/pkgs/development/python-modules/swift/default.nix b/pkgs/development/python-modules/swift/default.nix index 972cc9a8d25f..4abd394022cb 100644 --- a/pkgs/development/python-modules/swift/default.nix +++ b/pkgs/development/python-modules/swift/default.nix @@ -24,12 +24,12 @@ buildPythonPackage rec { pname = "swift"; - version = "2.35.1"; + version = "2.36.0"; pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-1C0l2TlXoiFzxaZIAWz3h1cq8f11LcwGi3slpknimHU="; + hash = "sha256-3qtd++4Xm6B9TPfKvx85s71/Hz8qFrhN+XR9TuvfHXw="; }; nativeBuildInputs = [ installShellFiles ]; diff --git a/pkgs/development/python-modules/textx/tests.nix b/pkgs/development/python-modules/textx/tests.nix index 00223ee6ac8f..fd45831d116a 100644 --- a/pkgs/development/python-modules/textx/tests.nix +++ b/pkgs/development/python-modules/textx/tests.nix @@ -1,5 +1,4 @@ { - lib, buildPythonPackage, attrs, click, @@ -50,9 +49,9 @@ buildPythonPackage { "test_examples" # assertion error: 0 == 12 ]; - meta = with lib; { + meta = { inherit (textx.meta) license maintainers; description = "passthru.tests for textx"; - homepage = textx.homepage + "tree/${version}/" + "tests/"; + homepage = textx.homepage + "tree/${textx.version}/" + "tests/"; }; } diff --git a/pkgs/development/python-modules/types-regex/default.nix b/pkgs/development/python-modules/types-regex/default.nix new file mode 100644 index 000000000000..5925a5b27e56 --- /dev/null +++ b/pkgs/development/python-modules/types-regex/default.nix @@ -0,0 +1,33 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + setuptools, +}: + +buildPythonPackage rec { + pname = "types-regex"; + version = "2025.9.1.20250903"; + pyproject = true; + + src = fetchPypi { + pname = "types_regex"; + inherit version; + hash = "sha256-IwEW9ktcCLBhCdlQCG5V/ICbiipdE+gCGKx880+arIQ="; + }; + + build-system = [ + setuptools + ]; + + pythonImportsCheck = [ + "regex-stubs" + ]; + + meta = { + description = "Typing stubs for regex"; + homepage = "https://github.com/python/typeshed"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ dwoffinden ]; + }; +} diff --git a/pkgs/development/python-modules/zenlog/default.nix b/pkgs/development/python-modules/zenlog/default.nix new file mode 100644 index 000000000000..e4668294108c --- /dev/null +++ b/pkgs/development/python-modules/zenlog/default.nix @@ -0,0 +1,32 @@ +{ + buildPythonPackage, + fetchPypi, + lib, + colorlog, + setuptools, +}: +let + pname = "zenlog"; + version = "1.1"; +in +buildPythonPackage { + inherit pname version; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-g0YKhfpySbgAfANoGmoLV1zm/gRDSTidPT1D9Y1Gh94="; + }; + + build-system = [ setuptools ]; + + dependencies = [ colorlog ]; + + meta = { + description = "Python script logging for the lazy"; + homepage = "https://github.com/ManufacturaInd/python-zenlog"; + changelog = "https://github.com/ManufacturaInd/python-zenlog/releases/tag/v${version}"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ S0AndS0 ]; + }; +} diff --git a/pkgs/development/tools/analysis/ikos/default.nix b/pkgs/development/tools/analysis/ikos/default.nix deleted file mode 100644 index f4ff446abe59..000000000000 --- a/pkgs/development/tools/analysis/ikos/default.nix +++ /dev/null @@ -1,84 +0,0 @@ -{ - stdenv, - lib, - fetchFromGitHub, - cmake, - boost, - tbb, - gmp, - llvm, - clang, - sqlite, - python3, - ocamlPackages, - mpfr, - ppl, - doxygen, - graphviz, -}: - -stdenv.mkDerivation rec { - pname = "ikos"; - version = "3.5"; - - src = fetchFromGitHub { - owner = "NASA-SW-VnV"; - repo = "ikos"; - rev = "v${version}"; - hash = "sha256-kqgGD0plTW0N30kD7Y8xOvGODplJbi37Wh6yYAkzNKI="; - }; - - nativeBuildInputs = [ - cmake - python3.pkgs.setuptools - python3.pkgs.wheel - python3.pkgs.build - python3.pkgs.installer - python3.pkgs.wrapPython - ]; - - buildInputs = [ - boost - tbb - gmp - clang - llvm - sqlite - python3 - ocamlPackages.apron - mpfr - ppl - doxygen - graphviz - ]; - - propagatedBuildInputs = [ - python3.pkgs.pygments - ]; - - cmakeFlags = [ - "-DAPRON_ROOT=${ocamlPackages.apron}" - "-DINSTALL_PYTHON_VIRTUALENV=off" - "-DPYTHON_VENV_EXECUTABLE=${python3}/bin/python" - ]; - - postBuild = '' - make doc - ${python3}/bin/python -m build --no-isolation --outdir dist/ --wheel analyzer/python - ''; - - postInstall = '' - ${python3}/bin/python -m installer --prefix "$out" dist/*.whl - ''; - - postFixup = '' - wrapPythonPrograms - ''; - - meta = with lib; { - homepage = "https://github.com/NASA-SW-VnV/ikos"; - description = "Static analyzer for C/C++ based on the theory of Abstract Interpretation"; - license = licenses.nasa13; - maintainers = with maintainers; [ atnnn ]; - }; -} diff --git a/pkgs/servers/home-assistant/custom-lovelace-modules/custom-sidebar/package.nix b/pkgs/servers/home-assistant/custom-lovelace-modules/custom-sidebar/package.nix index 91730f0e0e13..e4c888ab6c60 100644 --- a/pkgs/servers/home-assistant/custom-lovelace-modules/custom-sidebar/package.nix +++ b/pkgs/servers/home-assistant/custom-lovelace-modules/custom-sidebar/package.nix @@ -47,12 +47,12 @@ stdenvNoCC.mkDerivation (finalAttrs: { passthru.entrypoint = "custom-sidebar-yaml.js"; - meta = with lib; { + meta = { description = "Custom plugin that allows you to personalise the Home Assistant's sidebar per user or device basis"; homepage = "https://elchininet.github.io/custom-sidebar"; downloadPage = "https://github.com/elchininet/custom-sidebar"; - changelog = "https://github.com/elchininet/custom-sidebar/releases/tag/v${version}"; + changelog = "https://github.com/elchininet/custom-sidebar/releases/tag/v${finalAttrs.version}"; license = lib.licenses.asl20; - maintainers = with maintainers; [ kranzes ]; + maintainers = with lib.maintainers; [ kranzes ]; }; }) diff --git a/pkgs/servers/sql/postgresql/ext/pgroonga.nix b/pkgs/servers/sql/postgresql/ext/pgroonga.nix index 82611345c418..013c7d499088 100644 --- a/pkgs/servers/sql/postgresql/ext/pgroonga.nix +++ b/pkgs/servers/sql/postgresql/ext/pgroonga.nix @@ -11,13 +11,13 @@ postgresqlBuildExtension (finalAttrs: { pname = "pgroonga"; - version = "4.0.1"; + version = "4.0.2"; src = fetchFromGitHub { owner = "pgroonga"; repo = "pgroonga"; tag = "${finalAttrs.version}"; - hash = "sha256-a5nNtlUiFBuuqWAjIN0gU/FaoV3VpJh+/fab8R/77dw="; + hash = "sha256-hZy2qDI9bNFvcm7SbCMZxixPEXgPmjmeEOM4VoXKttE="; }; nativeBuildInputs = [ pkg-config ]; @@ -34,11 +34,6 @@ postgresqlBuildExtension (finalAttrs: { ]; meta = { - # PostgreSQL 18 support issue upstream: https://github.com/pgroonga/pgroonga/issues/708 - # Check after next package update. - broken = lib.warnIf ( - finalAttrs.version != "4.0.1" - ) "Is postgresql18Packages.pgroonga still broken?" (lib.versionAtLeast postgresql.version "18"); description = "PostgreSQL extension to use Groonga as the index"; longDescription = '' PGroonga is a PostgreSQL extension to use Groonga as the index. diff --git a/pkgs/test/default.nix b/pkgs/test/default.nix index 1335cb8b5e73..7d2f55ea440a 100644 --- a/pkgs/test/default.nix +++ b/pkgs/test/default.nix @@ -16,6 +16,12 @@ with pkgs; (filter (n: n != "llvmPackages_9")) (filter (n: n != "llvmPackages_10")) (filter (n: n != "llvmPackages_11")) + (filter (n: n != "llvmPackages_12")) + (filter (n: n != "llvmPackages_13")) + (filter (n: n != "llvmPackages_14")) + (filter (n: n != "llvmPackages_15")) + (filter (n: n != "llvmPackages_16")) + (filter (n: n != "llvmPackages_17")) ]; tests = lib.genAttrs pkgSets ( name: diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 569bad685317..b77212deae62 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -516,6 +516,7 @@ mapAliases { beatsabermodmanager = throw "'beatsabermodmanager' has been removed due to lack of upstream maintainenance. Consider using 'bs-manager' instead"; # Added 2025-03-18 betterbird = throw "betterbird has been removed as there were insufficient maintainer resources to keep up with security updates"; # Added 2024-10-25 betterbird-unwrapped = throw "betterbird has been removed as there were insufficient maintainer resources to keep up with security updates"; # Added 2024-10-25 + bfc = throw "bfc has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-10 bibata-extra-cursors = throw "bibata-cursors has been removed as it was broken"; # Added 2024-07-15 bitbucket-server-cli = throw "bitbucket-server-cli has been removed due to lack of maintenance upstream."; # Added 2025-05-27 bitcoin-abc = throw "bitcoin-abc has been removed due to a lack of maintanance"; # Added 2025-06-17 @@ -641,6 +642,7 @@ mapAliases { colloid-kde = throw "'colloid-kde' has been removed, as it is only compatible with Plasma 5, which is EOL"; # Added 2025-08-20 colorpicker = throw "'colorpicker' has been removed due to lack of maintenance upstream. Consider using 'xcolor', 'gcolor3', 'eyedropper' or 'gpick' instead"; # Added 2024-10-19 colorstorm = throw "'colorstorm' has been removed because it was unmaintained in nixpkgs and upstream was rewritten."; # Added 2025-06-15 + cone = throw "cone has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-10 connman-ncurses = throw "'connman-ncurses' has been removed due to lack of maintenance upstream."; # Added 2025-05-27 copilot-language-server-fhs = lib.warnOnInstantiate "The package set `copilot-language-server-fhs` has been renamed to `copilot-language-server`." copilot-language-server; # Added 2025-09-07 copper = throw "'copper' has been removed, as it was broken since 22.11"; # Added 2025-08-22 @@ -699,25 +701,9 @@ mapAliases { cyber = throw "cyber has been removed, as it does not build with supported Zig versions"; # Added 2025-08-09 # these are for convenience, not for backward compat., and shouldn't expire until the package is deprecated. - clang9Stdenv = throw "clang9Stdenv has been removed from nixpkgs"; # Added 2024-04-08 - clang12Stdenv = lowPrio llvmPackages_12.stdenv; # preserve, reason: see above - clang13Stdenv = lowPrio llvmPackages_13.stdenv; # preserve, reason: see above - clang14Stdenv = lowPrio llvmPackages_14.stdenv; # preserve, reason: see above - clang15Stdenv = lowPrio llvmPackages_15.stdenv; # preserve, reason: see above - clang16Stdenv = lowPrio llvmPackages_16.stdenv; # preserve, reason: see above - clang17Stdenv = lowPrio llvmPackages_17.stdenv; # preserve, reason: see above clang18Stdenv = lowPrio llvmPackages_18.stdenv; # preserve, reason: see above clang19Stdenv = lowPrio llvmPackages_19.stdenv; # preserve, reason: see above - clang-tools_9 = throw "clang-tools_9 has been removed from nixpkgs"; # Added 2024-04-08 - clang_9 = throw "clang_9 has been removed from nixpkgs"; # Added 2024-04-08 - - clang-tools_12 = llvmPackages_12.clang-tools; # Added 2024-04-22 - clang-tools_13 = llvmPackages_13.clang-tools; # Added 2024-04-22 - clang-tools_14 = llvmPackages_14.clang-tools; # Added 2024-04-22 - clang-tools_15 = llvmPackages_15.clang-tools; # Added 2024-04-22 - clang-tools_16 = llvmPackages_16.clang-tools; # Added 2024-04-22 - clang-tools_17 = llvmPackages_17.clang-tools; # Added 2024-04-22 clang-tools_18 = llvmPackages_18.clang-tools; # Added 2024-04-22 clang-tools_19 = llvmPackages_19.clang-tools; # Added 2024-08-21 @@ -726,6 +712,7 @@ mapAliases { ### D ### + dale = throw "dale has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-10 dap = throw "'dap' has been removed because it doesn't compile and has been unmaintained since 2014"; # Added 2025-05-10 daq = throw "'daq' has been removed as it is unmaintained and broken. Snort2 has also been removed, which depended on this"; # Added 2025-05-21 darling = throw "'darling' has been removed due to vendoring Python2"; # Added 2025-05-10 @@ -1161,6 +1148,7 @@ mapAliases { hiddify-app = throw "hiddify-app has been removed, since it is unmaintained"; # added 2025-08-20 hll2390dw-cups = throw "The hll2390dw-cups package was dropped since it was unmaintained."; # Added 2024-06-21 hoarder = throw "'hoarder' has been renamed to 'karakeep'"; # Added 2025-04-21 + hobbes = throw "hobbes has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-20 hmetis = throw "'hmetis' has been removed as it was unmaintained and the upstream was unavailable"; # Added 2025-05-05 hop-cli = throw "hop-cli has been removed as the service has been shut-down"; # Added 2024-08-13 hpp-fcl = coal; # Added 2024-11-15 @@ -1182,6 +1170,7 @@ mapAliases { ib-controller = throw "ib-controller has been removed from nixpkgs as it was broken"; # Added 2024-07-15 ibm-sw-tpm2 = throw "ibm-sw-tpm2 has been removed, as it was broken"; # Added 2025-08-25 icuReal = throw "icuReal has been removed from nixpkgs as a mistake"; # Added 2025-02-18 + ikos = throw "ikos has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-10 imagemagick7Big = throw "'imagemagick7Big' has been renamed to/replaced by 'imagemagickBig'"; # Converted to throw 2024-10-17 imagemagick7 = throw "'imagemagick7' has been renamed to/replaced by 'imagemagick'"; # Converted to throw 2024-10-17 imagemagick7_light = throw "'imagemagick7_light' has been renamed to/replaced by 'imagemagick_light'"; # Converted to throw 2024-10-17 @@ -1483,10 +1472,63 @@ mapAliases { llvmPackages_git = (callPackages ../development/compilers/llvm { }).git; # Added 2024-08-02 - lld_9 = throw "lld_9 has been removed from nixpkgs"; # Added 2024-04-08 - lldb_9 = throw "lldb_9 has been removed from nixpkgs"; # Added 2024-04-08 llvmPackages_9 = throw "llvmPackages_9 has been removed from nixpkgs"; # Added 2024-04-08 llvm_9 = throw "llvm_9 has been removed from nixpkgs"; # Added 2024-04-08 + lld_9 = throw "lld_9 has been removed from nixpkgs"; # Added 2024-04-08 + lldb_9 = throw "lldb_9 has been removed from nixpkgs"; # Added 2024-04-08 + clang_9 = throw "clang_9 has been removed from nixpkgs"; # Added 2024-04-08 + clang9Stdenv = throw "clang9Stdenv has been removed from nixpkgs"; # Added 2024-04-08 + clang-tools_9 = throw "clang-tools_9 has been removed from nixpkgs"; # Added 2024-04-08 + + llvmPackages_12 = throw "llvmPackages_12 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + llvm_12 = throw "llvm_12 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + lld_12 = throw "lld_12 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + lldb_12 = throw "lldb_12 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + clang_12 = throw "clang_12 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + clang12Stdenv = throw "clang12Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + clang-tools_12 = throw "clang-tools_12 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + + llvmPackages_13 = throw "llvmPackages_13 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + llvm_13 = throw "llvm_13 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + lld_13 = throw "lld_13 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + lldb_13 = throw "lldb_13 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + clang_13 = throw "clang_13 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + clang13Stdenv = throw "clang13Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + clang-tools_13 = throw "clang-tools_13 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + + llvmPackages_14 = throw "llvmPackages_14 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + llvm_14 = throw "llvm_14 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + lld_14 = throw "lld_14 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + lldb_14 = throw "lldb_14 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + clang_14 = throw "clang_14 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + clang14Stdenv = throw "clang14Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + clang-tools_14 = throw "clang-tools_14 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10 + + llvmPackages_15 = throw "llvmPackages_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12 + llvm_15 = throw "llvm_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12 + lld_15 = throw "lld_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12 + lldb_15 = throw "lldb_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12 + clang_15 = throw "clang_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12 + clang15Stdenv = throw "clang15Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12 + clang-tools_15 = throw "clang-tools_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12 + + llvmPackages_16 = throw "llvmPackages_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 + llvm_16 = throw "llvm_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 + lld_16 = throw "lld_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 + lldb_16 = throw "lldb_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 + mlir_16 = throw "mlir_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 + clang_16 = throw "clang_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 + clang16Stdenv = throw "clang16Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 + clang-tools_16 = throw "clang-tools_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 + + llvmPackages_17 = throw "llvmPackages_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 + llvm_17 = throw "llvm_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 + lld_17 = throw "lld_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 + lldb_17 = throw "lldb_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 + mlir_17 = throw "mlir_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 + clang_17 = throw "clang_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 + clang17Stdenv = throw "clang17Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 + clang-tools_17 = throw "clang-tools_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09 lobster-two = throw "'lobster-two' has been renamed to/replaced by 'google-fonts'"; # Converted to throw 2024-10-17 loc = throw "'loc' has been removed due to lack of upstream maintenance. Consider 'tokei' as an alternative."; # Added 2025-01-25 @@ -1661,6 +1703,7 @@ mapAliases { mpdWithFeatures = lib.warnOnInstantiate "mpdWithFeatures has been replaced by mpd.override" mpd.override; # Added 2025-08-08 mpdevil = plattenalbum; # Added 2024-05-22 mpg321 = throw "'mpg321' has been removed due to it being unmaintained by upstream. Consider using mpg123 instead."; # Added 2024-05-10 + mpris-discord-rpc = throw "'mpris-discord-rpc' has been renamed to 'music-discord-rpc'."; # Added 2025-09-14 mq-cli = throw "'mq-cli' has been removed due to lack of upstream maintenance"; # Added 2025-01-25 mrkd = throw "'mrkd' has been removed as it is unmaintained since 2021"; # Added 2024-12-21 msp430NewlibCross = msp430Newlib; # Added 2024-09-06 @@ -1801,6 +1844,7 @@ mapAliases { oauth2_proxy = throw "'oauth2_proxy' has been renamed to/replaced by 'oauth2-proxy'"; # Converted to throw 2024-10-17 obliv-c = throw "obliv-c has been removed from Nixpkgs, as it has been unmaintained upstream for 4 years and does not build with supported GCC versions"; # Added 2025-08-18 ocis-bin = throw "ocis-bin has been renamed to ocis_5-bin'. Future major.minor versions will be made available as separate packages"; # Added 2025-03-30 + oclgrind = throw "oclgrind has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-10 odoo15 = throw "odoo15 has been removed from nixpkgs as it is unsupported; migrate to a newer version of odoo"; # Added 2025-05-06 offrss = throw "offrss has been removed due to lack of upstream maintenance; consider using another rss reader"; # Added 2025-06-01 oil = lib.warnOnInstantiate "Oil has been replaced with the faster native C++ version and renamed to 'oils-for-unix'. See also https://github.com/oils-for-unix/oils/wiki/Oils-Deployments" oils-for-unix; # Added 2024-10-22 @@ -2076,6 +2120,7 @@ mapAliases { qcachegrind = throw "'qcachegrind' has been removed, as it depends on KDE Gear 5, which has reached EOL"; # Added 2025-08-20 qflipper = qFlipper; # Added 2022-02-11 qnial = throw "'qnial' has been removed due to failing to build and being unmaintained"; # Added 2025-06-26 + qrscan = throw "qrscan has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-19 qscintilla = libsForQt5.qscintilla; # Added 2023-09-20 qscintilla-qt6 = qt6Packages.qscintilla; # Added 2023-09-20 qt-video-wlr = throw "'qt-video-wlr' has been removed, as it depends on KDE Gear 5, which has reached EOL"; # Added 2025-08-20 @@ -2523,6 +2568,7 @@ mapAliases { ### W ### w_scan = throw "'w_scan' has been removed due to lack of upstream maintenance"; # Added 2025-08-29 wakatime = wakatime-cli; # 2024-05-30 + wavm = throw "wavm has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-10 wal_e = throw "wal_e was removed as it is unmaintained upstream and depends on the removed boto package; upstream recommends using wal-g or pgbackrest"; # Added 2024-09-22 wapp = tclPackages.wapp; # Added 2024-10-02 wavebox = throw "'wavebox' has been removed due to lack of maintenance in nixpkgs"; # Added 2025-06-24 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2327eaec988f..74ff82150ade 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2605,10 +2605,6 @@ with pkgs; compass = callPackage ../development/tools/compass { }; - cone = callPackage ../development/compilers/cone { - llvmPackages = llvmPackages_13; - }; - coreutils = callPackage ../tools/misc/coreutils { }; # The coreutils above are built with dependencies from @@ -4629,12 +4625,6 @@ with pkgs; clang-manpages = llvmPackages.clang-manpages; clang = llvmPackages.clang; - clang_12 = llvmPackages_12.clang; - clang_13 = llvmPackages_13.clang; - clang_14 = llvmPackages_14.clang; - clang_15 = llvmPackages_15.clang; - clang_16 = llvmPackages_16.clang; - clang_17 = llvmPackages_17.clang; clang-tools = llvmPackages.clang-tools; @@ -4724,13 +4714,7 @@ with pkgs; flutter327 = flutterPackages.v3_27; flutter324 = flutterPackages.v3_24; - fpc = callPackage ../development/compilers/fpc { - # https://github.com/NixOS/nixpkgs/issues/416485 - # TODO: remove when upstream issue is fixed: - # https://gitlab.com/freepascal.org/fpc/source/-/issues/41045 - stdenv = - if stdenv.cc.isClang && stdenv.hostPlatform.isx86_64 then llvmPackages_17.stdenv else stdenv; - }; + fpc = callPackage ../development/compilers/fpc { }; gambit = callPackage ../development/compilers/gambit { }; gambit-unstable = callPackage ../development/compilers/gambit/unstable.nix { }; @@ -5367,31 +5351,10 @@ with pkgs; }; lld = llvmPackages.lld; - lld_12 = llvmPackages_12.lld; - lld_13 = llvmPackages_13.lld; - lld_14 = llvmPackages_14.lld; - lld_15 = llvmPackages_15.lld; - lld_16 = llvmPackages_16.lld; - lld_17 = llvmPackages_17.lld; lldb = llvmPackages.lldb; - lldb_12 = llvmPackages_12.lldb; - lldb_13 = llvmPackages_13.lldb; - lldb_14 = llvmPackages_14.lldb; - lldb_15 = llvmPackages_15.lldb; - lldb_16 = llvmPackages_16.lldb; - lldb_17 = llvmPackages_17.lldb; llvm = llvmPackages.llvm; - llvm_12 = llvmPackages_12.llvm; - llvm_13 = llvmPackages_13.llvm; - llvm_14 = llvmPackages_14.llvm; - llvm_15 = llvmPackages_15.llvm; - llvm_16 = llvmPackages_16.llvm; - llvm_17 = llvmPackages_17.llvm; - - mlir_16 = llvmPackages_16.mlir; - mlir_17 = llvmPackages_17.mlir; flang = llvmPackages_20.flang; libclc = llvmPackages.libclc; @@ -5404,13 +5367,6 @@ with pkgs; (rec { llvmPackagesSet = recurseIntoAttrs (callPackages ../development/compilers/llvm { }); - llvmPackages_12 = llvmPackagesSet."12"; - llvmPackages_13 = llvmPackagesSet."13"; - llvmPackages_14 = llvmPackagesSet."14"; - llvmPackages_15 = llvmPackagesSet."15"; - llvmPackages_16 = llvmPackagesSet."16"; - llvmPackages_17 = llvmPackagesSet."17"; - llvmPackages_18 = llvmPackagesSet."18"; clang_18 = llvmPackages_18.clang; lld_18 = llvmPackages_18.lld; @@ -5442,12 +5398,6 @@ with pkgs; mkLLVMPackages = llvmPackagesSet.mkPackage; }) - llvmPackages_12 - llvmPackages_13 - llvmPackages_14 - llvmPackages_15 - llvmPackages_16 - llvmPackages_17 llvmPackages_18 clang_18 lld_18 @@ -6861,11 +6811,6 @@ with pkgs; iaca_3_0 = callPackage ../development/tools/iaca/3.0.nix { }; iaca = iaca_3_0; - ikos = callPackage ../development/tools/analysis/ikos { - inherit (llvmPackages_14) stdenv clang llvm; - tbb = tbb_2022; - }; - include-what-you-use = callPackage ../development/tools/analysis/include-what-you-use { llvmPackages = llvmPackages_20; }; diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index aeb5cef6c9b5..6da3d9639348 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -48,6 +48,9 @@ let # Use this rather than `rec { ... }` below for sake of overlays. inherit (pkgs.haskell) compiler packages; + buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_20; + llvmPackages = pkgs.llvmPackages_20; + in { lib = haskellLibUncomposable; @@ -72,7 +75,7 @@ in { # Required to bootstrap 9.4.8. ghc902Binary = callPackage ../development/compilers/ghc/9.0.2-binary.nix { - llvmPackages = pkgs.llvmPackages_20; + inherit llvmPackages; }; ghc924Binary = callPackage ../development/compilers/ghc/9.2.4-binary.nix { }; @@ -91,9 +94,7 @@ in # https://github.com/xattr/xattr/issues/44 and # https://github.com/xattr/xattr/issues/55 are solved. inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook; - # Support range >= 10 && < 14 - buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_12; - llvmPackages = pkgs.llvmPackages_12; + inherit buildTargetLlvmPackages llvmPackages; }; ghc94 = compiler.ghc948; ghc963 = callPackage ../development/compilers/ghc/9.6.3.nix { @@ -103,9 +104,7 @@ in # https://github.com/xattr/xattr/issues/44 and # https://github.com/xattr/xattr/issues/55 are solved. inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook; - # Support range >= 11 && < 16 - buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_15; - llvmPackages = pkgs.llvmPackages_15; + inherit buildTargetLlvmPackages llvmPackages; }; ghc967 = callPackage ../development/compilers/ghc/9.6.7.nix { bootPkgs = bb.packages.ghc924Binary; @@ -114,9 +113,7 @@ in # https://github.com/xattr/xattr/issues/44 and # https://github.com/xattr/xattr/issues/55 are solved. inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook; - # Support range >= 11 && < 16 - buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_15; - llvmPackages = pkgs.llvmPackages_15; + inherit buildTargetLlvmPackages llvmPackages; }; ghc96 = compiler.ghc967; ghc984 = callPackage ../development/compilers/ghc/9.8.4.nix { @@ -130,9 +127,7 @@ in # https://github.com/xattr/xattr/issues/44 and # https://github.com/xattr/xattr/issues/55 are solved. inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook; - # Support range >= 11 && < 16 - buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_15; - llvmPackages = pkgs.llvmPackages_15; + inherit buildTargetLlvmPackages llvmPackages; }; ghc98 = compiler.ghc984; ghc9101 = callPackage ../development/compilers/ghc/9.10.1.nix { @@ -151,9 +146,7 @@ in # https://github.com/xattr/xattr/issues/44 and # https://github.com/xattr/xattr/issues/55 are solved. inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook; - # 2023-01-15: Support range >= 11 && < 16 - buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_15; - llvmPackages = pkgs.llvmPackages_15; + inherit buildTargetLlvmPackages llvmPackages; }; ghc9102 = callPackage ../development/compilers/ghc/9.10.2.nix { bootPkgs = @@ -171,9 +164,7 @@ in # https://github.com/xattr/xattr/issues/44 and # https://github.com/xattr/xattr/issues/55 are solved. inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook; - # 2023-01-15: Support range >= 11 && < 16 - buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_15; - llvmPackages = pkgs.llvmPackages_15; + inherit buildTargetLlvmPackages llvmPackages; }; ghc9103 = callPackage ../development/compilers/ghc/9.10.3.nix { bootPkgs = @@ -205,9 +196,7 @@ in # https://github.com/xattr/xattr/issues/44 and # https://github.com/xattr/xattr/issues/55 are solved. inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook; - # 2024-12-21: Support range >= 13 && < 20 - buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_19; - llvmPackages = pkgs.llvmPackages_19; + inherit buildTargetLlvmPackages llvmPackages; }; ghc9122 = callPackage ../development/compilers/ghc/9.12.2.nix { bootPkgs = @@ -218,9 +207,7 @@ in # https://github.com/xattr/xattr/issues/44 and # https://github.com/xattr/xattr/issues/55 are solved. inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook; - # 2024-12-21: Support range >= 13 && < 20 - buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_19; - llvmPackages = pkgs.llvmPackages_19; + inherit buildTargetLlvmPackages llvmPackages; }; ghc912 = compiler.ghc9122; ghcHEAD = callPackage ../development/compilers/ghc/head.nix { @@ -230,9 +217,7 @@ in # https://github.com/xattr/xattr/issues/44 and # https://github.com/xattr/xattr/issues/55 are solved. inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook; - # 2023-01-15: Support range >= 11 && < 16 - buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_18; - llvmPackages = pkgs.llvmPackages_18; + inherit buildTargetLlvmPackages llvmPackages; }; # Starting from GHC 9, integer-{simple,gmp} is replaced by ghc-bignum diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 11c7b99881f5..f46afb3bc10e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4356,6 +4356,8 @@ self: super: with self; { doubleratchet = callPackage ../development/python-modules/doubleratchet { }; + doubles = callPackage ../development/python-modules/doubles { }; + dowhen = callPackage ../development/python-modules/dowhen { }; downloader-cli = callPackage ../development/python-modules/downloader-cli { }; @@ -6854,6 +6856,8 @@ self: super: with self; { hydra-core = callPackage ../development/python-modules/hydra-core { }; + hydra-joblib-launcher = callPackage ../development/python-modules/hydra-joblib-launcher { }; + hydrawiser = callPackage ../development/python-modules/hydrawiser { }; hydrogram = callPackage ../development/python-modules/hydrogram { }; @@ -19304,6 +19308,8 @@ self: super: with self; { types-redis = callPackage ../development/python-modules/types-redis { }; + types-regex = callPackage ../development/python-modules/types-regex { }; + types-requests = callPackage ../development/python-modules/types-requests { }; types-retry = callPackage ../development/python-modules/types-retry { }; @@ -20469,6 +20475,8 @@ self: super: with self; { zeitgeist = (toPythonModule (pkgs.zeitgeist.override { python3 = python; })).py; + zenlog = callPackage ../development/python-modules/zenlog { }; + zenoh = callPackage ../development/python-modules/zenoh { }; zephyr-python-api = callPackage ../development/python-modules/zephyr-python-api { };