# Changing the default x86-64 compilation target to v2 or v3

**URL:** <https://internals.rust-lang.org/t/changing-the-default-x86-64-compilation-target-to-v2-or-v3/21889>\
**Category:** compiler\
**Created:** [November 21, 2024, 1:36am UTC](https://internals.rust-lang.org/t/changing-the-default-x86-64-compilation-target-to-v2-or-v3/21889 "2024-11-21T01:36:01Z")\
**Posts on this page:** 11\
**Page:** 4

<div class="post-metadata">

**Author:** ![mathstuf](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mathstuf](https://internals.rust-lang.org/u/mathstuf)\
**Post date:** [October 27, 2025, 12:17am UTC](https://internals.rust-lang.org/t/changing-the-default-x86-64-compilation-target-to-v2-or-v3/21889/61 "2025-10-27T00:17:10Z")

</div>

> [@zackw](#):
>
> I think I saw something go by about tagging ELF shared objects with subarchitecture requirements so that the dynamic loader will refuse to load modules that the CPU can't handle

I think you're referring to the `glibc Hardware capabilities` section in `ld.so(8)` which will additionally search `glibc-hwcaps/$subarch` in each search path directory first to load hwcap-aware builds of libraries.

---

<div class="post-metadata">

**Author:** ![ais523](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@ais523](https://internals.rust-lang.org/u/ais523)\
**Post date:** [October 27, 2025, 6:05am UTC](https://internals.rust-lang.org/t/changing-the-default-x86-64-compilation-target-to-v2-or-v3/21889/62 "2025-10-27T06:05:07Z")

</div>

> [@zackw](#):
>
> The path of least resistance for X and Wayland may well be to fork off a [`notify-send`](https://man.archlinux.org/man/notify-send.1.en) process.

One problem here is that you'd need to ensure that a) `notify-send` is installed, and b) it's the executable the program thinks that it is, rather than some other file with the same name. For example, looking for a `notify-send` on $PATH could be a security bug if the user is running a program with more permissions than they have themself, as they could cause the program to find a malicious `notify-send` executable rather than the one they were looking for. (This might end up not being a real problem in practice, though – it would be rare for a program that isn't compatible with the current CPU architecture to be given elevated permssions.)

---

<div class="post-metadata">

**Author:** ![zackw](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/zackw/32/2071_2.png) [@zackw](https://internals.rust-lang.org/u/zackw)\
**Post date:** [October 27, 2025, 5:32pm UTC](https://internals.rust-lang.org/t/changing-the-default-x86-64-compilation-target-to-v2-or-v3/21889/63 "2025-10-27T17:32:19Z")

</div>

> [@ais523](#):
>
> you'd need to ensure that a) `notify-send` is installed, and b) it's the executable the program thinks that it is

The way Unix works is you aren't supposed to worry about either of those things. You run the `notify-send` binary on your PATH. If it doesn't exist, you print a message on stderr and give up. If it exists but doesn't do the job—for a very abstract definition of "does the job"; the human controlling the machine is _entitled_ to put a `notify-send` binary in the first directory on the PATH that discards all notifications—then the system is misconfigured and it's not your problem to fix it.

A set-id binary must sanitize its PATH (and a whole bunch of other environment variables) but this is not a new requirement, and nowadays it's my impression that set-id binaries are considered bad practice, period.

---

<div class="post-metadata">

**Author:** ![SkiFire13](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/skifire13/32/7579_2.png) [@SkiFire13](https://internals.rust-lang.org/u/SkiFire13)\
**Post date:** [October 28, 2025, 12:23pm UTC](https://internals.rust-lang.org/t/changing-the-default-x86-64-compilation-target-to-v2-or-v3/21889/64 "2025-10-28T12:23:29Z")

</div>

> [@zackw](#):
>
> If it exists but doesn't do the job—for a very abstract definition of "does the job"; the human controlling the machine is _entitled_ to put a `notify-send` binary in the first directory on the PATH that discards all notifications—then the system is misconfigured and it's not your problem to fix it.

That only works if you have an oracle telling you that `notify-send` is misconfigured, otherwise the only thing you see is the program immediately closing without any error message and at that point what tells you whether it's your problem to fix or not?

---

<div class="post-metadata">

**Author:** ![Vorpal](https://avatars.discourse-cdn.com/v4/letter/v/aca169/32.png) [@Vorpal](https://internals.rust-lang.org/u/Vorpal)\
**Post date:** [October 28, 2025, 5:58pm UTC](https://internals.rust-lang.org/t/changing-the-default-x86-64-compilation-target-to-v2-or-v3/21889/65 "2025-10-28T17:58:38Z")

</div>

Then on Linux it is up to the user to run it again in a terminal, possibly with strace if there is nothing helpful on the terminal.

You might argue it is not good UX. You would be right if you argued that. There is a reason it isn't yet the year of the Linux desktop.

(I say that and I do run KDE on Linux. Make of that what you will.)

---

<div class="post-metadata">

**Author:** ![josh](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/josh/32/5934_2.png) [@josh](https://internals.rust-lang.org/u/josh)\
**Post date:** [October 28, 2025, 7:20pm UTC](https://internals.rust-lang.org/t/changing-the-default-x86-64-compilation-target-to-v2-or-v3/21889/66 "2025-10-28T19:20:35Z")

</div>

Lest we go too far down the rabbit hole of `notify-send`: I don't think we should ever spawn a program for this. Printing a warning is one thing, spawning a program would be too much complexity with too many downsides.

---

<div class="post-metadata">

**Author:** ![zackw](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/zackw/32/2071_2.png) [@zackw](https://internals.rust-lang.org/u/zackw)\
**Post date:** [November 4, 2025, 2:02pm UTC](https://internals.rust-lang.org/t/changing-the-default-x86-64-compilation-target-to-v2-or-v3/21889/67 "2025-11-04T14:02:41Z")

</div>

> [@josh](#):
>
> I don't think we should ever spawn a program for this.

Honestly I think it's a bug in most current Unix GUI environments that stderr messages from GUI applications are discarded. They should at least get logged somewhere, and if an application abends they should get surfaced to the user.

---

<div class="post-metadata">

**Author:** ![bjorn3](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/bjorn3/32/2736_2.png) [@bjorn3](https://internals.rust-lang.org/u/bjorn3)\
**Post date:** [November 4, 2025, 3:19pm UTC](https://internals.rust-lang.org/t/changing-the-default-x86-64-compilation-target-to-v2-or-v3/21889/68 "2025-11-04T15:19:18Z")

</div>

> [@zackw](#):
>
> They should at least get logged somewhere

It used to end up in your Xorg log. Nowadays I think it ends up in your user's journald log.

---

<div class="post-metadata">

**Author:** ![mathstuf](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mathstuf](https://internals.rust-lang.org/u/mathstuf)\
**Post date:** [November 4, 2025, 3:28pm UTC](https://internals.rust-lang.org/t/changing-the-default-x86-64-compilation-target-to-v2-or-v3/21889/69 "2025-11-04T15:28:52Z")

</div>

> [@zackw](#):
>
> They should at least get logged somewhere, and if an application abends they should get surfaced to the user.

> [@bjorn3](#):
>
> It used to end up in your Xorg log. Nowadays I think it ends up in your user's journald log.

I run my GUI applications with `systemd-run` so _mine_ end up in the journal. I don't think the "main" desktops have gone this route however.

---

<div class="post-metadata">

**Author:** ![bjorn3](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/bjorn3/32/2736_2.png) [@bjorn3](https://internals.rust-lang.org/u/bjorn3)\
**Post date:** [November 4, 2025, 3:49pm UTC](https://internals.rust-lang.org/t/changing-the-default-x86-64-compilation-target-to-v2-or-v3/21889/70 "2025-11-04T15:49:10Z")

</div>

I use XFCE on Debian. Basically all applications I didn't open from a terminal have the same socket as stdout and stderr. This includes gdm-x-session, of which I see a lot of logs in my user journal. So it might be that gdm handles this.

---

<div class="post-metadata">

**Author:** ![kornel](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/kornel/32/2711_2.png) [@kornel](https://internals.rust-lang.org/u/kornel)\
**Post date:** [November 4, 2025, 5:39pm UTC](https://internals.rust-lang.org/t/changing-the-default-x86-64-compilation-target-to-v2-or-v3/21889/71 "2025-11-04T17:39:06Z")

</div>

Built-in GUI notifications sound like a scope creep. I'm worried that going down that path will just make the change more difficult, and delay or derail it. An stderr message would already be a good start, and the notification mechanism perhaps could be made extensible later.

[Previous page](https://internals.rust-lang.org/t/changing-the-default-x86-64-compilation-target-to-v2-or-v3/21889.md?page=3)
