Skip to content

icecc-create-env: fix adding the glibc-hwcaps libs#653

Merged
HenryMiller1 merged 2 commits intoicecc:masterfrom
thiagomacieira:fix-glibc-hwcaps
Feb 2, 2026
Merged

icecc-create-env: fix adding the glibc-hwcaps libs#653
HenryMiller1 merged 2 commits intoicecc:masterfrom
thiagomacieira:fix-glibc-hwcaps

Conversation

@thiagomacieira
Copy link
Contributor

Since a recent upgrade of glibc (I'm not exactly certain when it happened, but it may have been a while), ldd prints the real path of a glibc-hwcap library that may have been cached. For example:

$ ldd /lib64/gcc/x86_64-suse-linux/15/cc1
        linux-vdso.so.1 (0x00007fad93d6f000)
        libisl.so.23 => /lib64/libisl.so.23 (0x00007fad93a00000)
        libmpc.so.3 => /lib64/libmpc.so.3 (0x00007fad93d27000)
        libmpfr.so.6 => /lib64/libmpfr.so.6 (0x00007fad93c6a000)
        libgmp.so.10 => /lib64/libgmp.so.10 (0x00007fad93956000)
        libz.so.1 => /lib64/glibc-hwcaps/x86-64-v3/libz.so.1.3.1 (0x00007fad93c4e000)
        libzstd.so.1 => /lib64/glibc-hwcaps/x86-64-v3/libzstd.so.1.5.7 (0x00007fad9387d000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fad93782000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fad93400000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fad93d71000)

This results in icecc-create-env storing /lib64/libz.so.1.3.1 but no /lib64/libz.so.1, which in turn causes the compiler to fail to start.

Moreover, the glibc-hwcaps libs themselves were never added. This PR fixes that. After this:

adding file /lib64/libz.so.1=/usr/lib64/libz.so.1.3.1
adding file /lib64/glibc-hwcaps/x86-64-v3/libz.so.1=/usr/lib64/glibc-hwcaps/x86-64-v3/libz.so.1.3.1
adding file /lib64/libzstd.so.1=/usr/lib64/libzstd.so.1.5.7
adding file /lib64/glibc-hwcaps/x86-64-v3/libzstd.so.1=/usr/lib64/glibc-hwcaps/x86-64-v3/libzstd.so.1.5.7

Since a recent upgrade of glibc (I'm not exactly certain when it
happened, but it may have been a while), ldd prints the real path of a
glibc-hwcap library that may have been cached. For example:

```
$ ldd /lib64/gcc/x86_64-suse-linux/15/cc1
        linux-vdso.so.1 (0x00007fad93d6f000)
        libisl.so.23 => /lib64/libisl.so.23 (0x00007fad93a00000)
        libmpc.so.3 => /lib64/libmpc.so.3 (0x00007fad93d27000)
        libmpfr.so.6 => /lib64/libmpfr.so.6 (0x00007fad93c6a000)
        libgmp.so.10 => /lib64/libgmp.so.10 (0x00007fad93956000)
        libz.so.1 => /lib64/glibc-hwcaps/x86-64-v3/libz.so.1.3.1 (0x00007fad93c4e000)
        libzstd.so.1 => /lib64/glibc-hwcaps/x86-64-v3/libzstd.so.1.5.7 (0x00007fad9387d000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fad93782000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fad93400000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fad93d71000)
```

This results in icecc-create-env storing /lib64/libz.so.1.3.1 but no
/lib64/libz.so.1, which in turn causes the compiler to fail to start.
We were overwriting the `lib` variable with the base lib, thus the
`case` statement below never matched anything. So just don't do it.

Drive-by use "skipldd" to addfile, as all of these libraries come from
ldd, which in turn means their dependencies are showing up in the
current file's dependencies anyway.

Now:
```
adding file /lib64/libz.so.1=/usr/lib64/libz.so.1.3.1
adding file /lib64/glibc-hwcaps/x86-64-v3/libz.so.1=/usr/lib64/glibc-hwcaps/x86-64-v3/libz.so.1.3.1
adding file /lib64/libzstd.so.1=/usr/lib64/libzstd.so.1.5.7
adding file /lib64/glibc-hwcaps/x86-64-v3/libzstd.so.1=/usr/lib64/glibc-hwcaps/x86-64-v3/libzstd.so.1.5.7
```
@thiagomacieira
Copy link
Contributor Author

Fixes the same as #627.

@HenryMiller1
Copy link
Collaborator

Would it be better to just merge #627 ?

@thiagomacieira
Copy link
Contributor Author

Would it be better to just merge #627 ?

I think my patch is superior.

@HenryMiller1 HenryMiller1 merged commit eb744af into icecc:master Feb 2, 2026
0 of 2 checks passed
gfunkmonk added a commit to gfunkmonk/icecream that referenced this pull request Feb 3, 2026
icecc-create-env: fix adding the glibc-hwcaps libs (icecc#653)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants