Meson Build system error

### Describe the bug

I am [building from source](https://scikit-learn.org/stable/developers/advanced_installation.html#building-from-source) with Miniforge3. This previously worked in `1.6.dev0`, but when I tried this time I got a Segmentation fault

### Steps/Code to Reproduce

```
$ conda create -n sklearn-env -c conda-forge python numpy scipy cython meson-python ninja
$ conda activate sklearn-env
$ pip install --editable . \
     --verbose --no-build-isolation \
     --config-settings editable-verbose=true
```

### Expected Results

```
$ python -c "import sklearn; sklearn.show_versions()"

1.7.dev0
```


### Actual Results

```
Using pip 24.3.1 from /home/success/miniforge3/envs/sklearn-env/lib/python3.13/site-packages/pip (python 3.13)
Obtaining file:///home/success/Desktop/scikit-learn
  Running command Checking if build backend supports build_editable
  Checking if build backend supports build_editable ... done
  Running command Preparing editable metadata (pyproject.toml)
  + meson setup /home/success/Desktop/scikit-learn /home/success/Desktop/scikit-learn/build/cp313 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/home/success/Desktop/scikit-learn/build/cp313/meson-python-native-file.ini
  The Meson build system
  Version: 1.6.0
  Source dir: /home/success/Desktop/scikit-learn
  Build dir: /home/success/Desktop/scikit-learn/build/cp313
  Build type: native build
  Project name: scikit-learn
  Project version: 1.7.dev0

  ../../meson.build:1:0: ERROR: Unable to get gcc pre-processor defines:
  Compiler stdout:

  -----
  Compiler stderr:
  <built-in>: internal compiler error: Segmentation fault
  0x7e8c4244531f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
  0x7e8c4242a1c9 __libc_start_call_main
        ../sysdeps/nptl/libc_start_call_main.h:58
  0x7e8c4242a28a __libc_start_main_impl
        ../csu/libc-start.c:360
  Please submit a full bug report, with preprocessed source (by using -freport-bug).
  Please include the complete backtrace with any bug report.
  See <file:///usr/share/doc/gcc-13/README.Bugs> for instructions.

  -----


  A full log can be found at /home/success/Desktop/scikit-learn/build/cp313/meson-logs/meson-log.txt
  error: subprocess-exited-with-error
  
  × Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /home/success/miniforge3/envs/sklearn-env/bin/python3.13 /home/success/miniforge3/envs/sklearn-env/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_editable /tmp/tmpdr9o_eip
  cwd: /home/success/Desktop/scikit-learn
  Preparing editable metadata (pyproject.toml) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
```

### Versions

```shell
Ubuntu 24.04.1 LTS
```

COMMENT:
This is likely not a scikit-learn issue but more something that has to do with your OS setup ... if that worked before this is very likely not a 1.6 vs 1.7 but more something that you updated in the OS in the mean time. 

I am going to close this one, but in case you figure out that something is wrong in scikit-learn (which I would think is highly unlikely) please reopen.

Good luck with tracking that down ... the kind of suggestions I have off the top of my head:
- do a OS update with apt-get
- reinstall the gcc-related packages hoping that the issue goes away

The error below seems to say that doing something with gcc leads to a Segmentation fault, which you know is very very unexpected:
```
../../meson.build:1:0: ERROR: Unable to get gcc pre-processor defines:
  Compiler stdout:

  -----
  Compiler stderr:
  <built-in>: internal compiler error: Segmentation fault
  0x7e8c4244531f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
  0x7e8c4242a1c9 __libc_start_call_main
        ../sysdeps/nptl/libc_start_call_main.h:58
  0x7e8c4242a28a __libc_start_main_impl
        ../csu/libc-start.c:360
  Please submit a full bug report, with preprocessed source (by using -freport-bug).
  Please include the complete backtrace with any bug report.
  See <file:///usr/share/doc/gcc-13/README.Bugs> for instructions.

  -----
```

Labels: Bug, Needs Triage