Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] I cannot compile any C programs after an update.
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
compreation
n00b
n00b


Joined: 12 Sep 2024
Posts: 5

PostPosted: Thu Sep 12, 2024 8:59 am    Post subject: [Solved] I cannot compile any C programs after an update. Reply with quote

I went to go and update my system i synced then saw that portage had an update updated it then i updated @world it compiled sys-libs/glibc net-misc/curl and dev-cpp/cpp-httplib
but then it tried to update www-client/librewolf and it kept failing to compile. I then tried to compile another package gui-apps/wbg then i realized that i cannot compile
any C programs. I then tried to emerge gui-wm/river (written in zig) and app-misc/lf (writen in go) and they both compiled just fine so it seems to be just C and C++ that
do not compile. I should also mention that i was using -O3 but then changed it to -O2 to try solve this issue but it did not work.

Emerge log
https://pastebin.com/UAJTGVfA

Logs for librewolf
https://pastebin.com/jAkUJ5UA
https://pastebin.com/rPP29hSu

Logs for wbg
https://pastebin.com/YSjJsy5L
https://pastebin.com/67dy4DzY

Any help would greatly appreciated.


Last edited by compreation on Sat Sep 14, 2024 1:27 am; edited 2 times in total
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3909

PostPosted: Thu Sep 12, 2024 9:09 am    Post subject: Reply with quote

These seem odd
Code:

SHELL="/bin/zsh"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"

Plz do not use zsh for root.
Also
Quote:

ERROR: www-client/librewolf-130.0_p3-r1::librewolf failed (configure phase):
* Failed to read clang version!
and
meson.build:1:0: ERROR: Unknown compiler(s): [['x86_64-pc-linux-gnu-gcc']]

Also plz use GCC:13 not GCC:14
Plz post
Code:

 gcc-config -l

_________________
:)
Back to top
View user's profile Send private message
compreation
n00b
n00b


Joined: 12 Sep 2024
Posts: 5

PostPosted: Thu Sep 12, 2024 9:48 am    Post subject: Reply with quote

Quote:
Also plz use GCC:13 not GCC:14
Plz post
Code:
 gcc-config -l


I tried to emerge gcc 13 but could not here are the logs.
https://pastebin.com/Cq9VwcHU
https://pastebin.com/94GGt6He

Also here is the output of gcc-config -l
Code:
 [1] x86_64-pc-linux-gnu-14 *
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3909

PostPosted: Thu Sep 12, 2024 10:09 am    Post subject: Reply with quote

Quote:

Gentoo-Desktop /home/compreation # doas emerge -av1 gcc:13
doas (root@Gentoo-Desktop) password:

Plz run emerge as root not with doas.
Also do
Code:

chsh -s /bin/bash root
chsh -s /bin/bash <user>


_________________
:)


Last edited by alamahant on Thu Sep 12, 2024 10:13 am; edited 1 time in total
Back to top
View user's profile Send private message
4nykey
Apprentice
Apprentice


Joined: 11 Feb 2004
Posts: 180

PostPosted: Thu Sep 12, 2024 10:12 am    Post subject: Reply with quote

Update to dev-cpp/cpp-httplib-0.17.3 broke every single compiler on my sytem as well due to missing symbol in the lib.
Luckily I was able to restore 0.17.2 from backup.
Can't tell what do you do in a situation like this, get a binary package of any C compiler, perhaps
Back to top
View user's profile Send private message
compreation
n00b
n00b


Joined: 12 Sep 2024
Posts: 5

PostPosted: Thu Sep 12, 2024 10:13 am    Post subject: Reply with quote

alamahant wrote:
Quote:

Gentoo-Desktop /home/compreation # doas emerge -av1 gcc:13
doas (root@Gentoo-Desktop) password:

Plz run emerge as root not with doas.


Okay here is the log as root.
https://pastebin.com/maB3sWGC
Back to top
View user's profile Send private message
compreation
n00b
n00b


Joined: 12 Sep 2024
Posts: 5

PostPosted: Thu Sep 12, 2024 10:17 am    Post subject: Reply with quote

4nykey wrote:
Update to dev-cpp/cpp-httplib-0.17.3 broke every single compiler on my sytem as well due to missing symbol in the lib.
Luckily I was able to restore 0.17.2 from backup.
Can't tell what do you do in a situation like this, get a binary package of any C compiler, perhaps


Well then i guess ill try that.
Back to top
View user's profile Send private message
compreation
n00b
n00b


Joined: 12 Sep 2024
Posts: 5

PostPosted: Thu Sep 12, 2024 11:11 am    Post subject: Reply with quote

4nykey wrote:
Update to dev-cpp/cpp-httplib-0.17.3 broke every single compiler on my sytem as well due to missing symbol in the lib.
Luckily I was able to restore 0.17.2 from backup.
Can't tell what do you do in a situation like this, get a binary package of any C compiler, perhaps


I looked at the dependencies for cpp-httplib and realized that the only thing that depends on it is ccache so i disabled it and now i can compile things just fine
no need for a reinstall.

Also having figured this out makes me feel greater then i ever have before a state of pure euphoria and adrenaline.

Edit - What it was is that ccache is broken and it still is so does that really count as solved?
Back to top
View user's profile Send private message
4nykey
Apprentice
Apprentice


Joined: 11 Feb 2004
Posts: 180

PostPosted: Thu Sep 12, 2024 12:10 pm    Post subject: Reply with quote

compreation wrote:
I looked at the dependencies for cpp-httplib and realized that the only thing that depends on it is ccache so i disabled it and now i can compile things just fine
no need for a reinstall.

Oh, good find )
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2201

PostPosted: Thu Sep 12, 2024 12:20 pm    Post subject: Reply with quote

4nykey wrote:
Update to dev-cpp/cpp-httplib-0.17.3 broke every single compiler on my sytem as well due to missing symbol in the lib.


That's impossible. I see only llvm depends on that library *if* debuginfod USE flag is enabled.
Best Regards,
Georgi
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31186
Location: here

PostPosted: Thu Sep 12, 2024 12:49 pm    Post subject: Reply with quote

Moved from Other Things Gentoo to Portage & Programming.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2800

PostPosted: Thu Sep 12, 2024 1:43 pm    Post subject: Reply with quote

About gcc:13 given it's been suggested, please stick to gcc:14 -- downgrading gcc is not safe due to libstdc++ and will just cause further problems similarly to trying to downgrade glibc without specific/careful use.

That aside, see already noticed it's ccache. Seen someone else run into that earlier too.

Edit: the subslot will be bumped due to changed ABI to cause ccache to be rebuilt, albeit portage may not schedule ccache ideally so it may be necessary to disable it then emerge --oneshot ccache to fix it. Using more static linking may be looked at in the future for ccache itself given it's a special case.
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 445

PostPosted: Thu Sep 12, 2024 3:25 pm    Post subject: Reply with quote

alamahant wrote:
These seem odd
Code:

SHELL="/bin/zsh"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"

Plz do not use zsh for root.


Why?
Back to top
View user's profile Send private message
dwardo
n00b
n00b


Joined: 10 Nov 2004
Posts: 56
Location: France

PostPosted: Thu Sep 12, 2024 9:09 pm    Post subject: Reply with quote

4nykey wrote:
Update to dev-cpp/cpp-httplib-0.17.3 broke every single compiler on my sytem as well due to missing symbol in the lib.
I looked at the dependencies for cpp-httplib and realized that the only thing that depends on it is ccache so i disabled it and now i can compile things just fine
no need for a reinstall.


Thanks for this. I just remerged ccache (without ccache) and all was well after that.
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 393
Location: Naarm/Melbourne, Australia

PostPosted: Fri Sep 13, 2024 2:20 am    Post subject: Reply with quote

sMueggli wrote:
alamahant wrote:
Plz do not use zsh for root.

Why?

Because Portage assumes that bash is the shell, and the differences between bash and zsh can potentially cause issues. One example: bash has 'shopt', zsh has 'setopt'. If some script assumes it can call 'shopt' because it's assuming bash is the shell, that's not going to work when zsh is the shell, and that could potentially result in unexpected behaviour.

i'm a zsh user myself, but i've kept bash as the shell for root, due to the above.
Back to top
View user's profile Send private message
4nykey
Apprentice
Apprentice


Joined: 11 Feb 2004
Posts: 180

PostPosted: Fri Sep 13, 2024 8:22 am    Post subject: Reply with quote

logrusx wrote:
4nykey wrote:
Update to dev-cpp/cpp-httplib-0.17.3 broke every single compiler on my sytem as well due to missing symbol in the lib.


That's impossible. I see only llvm depends on that library *if* debuginfod USE flag is enabled.
Best Regards,
Georgi

Okay I was in a hurry to restore my sytsem and portage logs were complaining about cpp-httplib ABI breakage for both gcc and clang, apparently due to ccache masquerade, which I totally overlooked. Now that we cleared that just few posts above yours, the question remains, whoever commited the cpp-httplib verbump to to main tree, didn't spotted the breakage of the main consumer?
Then again why oh why ccache needs http? I mean could it be made optional, patched-away?
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2201

PostPosted: Fri Sep 13, 2024 8:42 am    Post subject: Reply with quote

4nykey wrote:
the question remains, whoever committed the cpp-httplib verbump to to main tree, didn't spotted the breakage of the main consumer?


Mistakes happen. Gentoo is maintained by its developers but also by its users who report problems :)

4nykey wrote:
Then again why oh why ccache needs http?


If you're keen on finding out, maybe download the sources and try compiling it without httplib and see where it breaks. Maybe someone got lazy and decided to use that one function from httplib they didn't want to write. They might even wrote some code to accommodate it...

Best Regards,
Georgi
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 393
Location: Naarm/Melbourne, Australia

PostPosted: Fri Sep 13, 2024 9:47 am    Post subject: Reply with quote

4nykey wrote:
why oh why ccache needs http?

As described in ccache's documentation, it supports configuring an HTTP-based remote data storage backend.
4nykey wrote:
I mean could it be made optional, patched-away?

In theory, it probably could. In practice, doing so might require more initial and ongoing maintenance work than the Toolchain Project devs have available. You'd need to speak to them to know.
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 445

PostPosted: Fri Sep 13, 2024 5:19 pm    Post subject: Reply with quote

flexibeast wrote:
sMueggli wrote:
alamahant wrote:
Plz do not use zsh for root.

Why?

Because Portage assumes that bash is the shell, and the differences between bash and zsh can potentially cause issues. One example: bash has 'shopt', zsh has 'setopt'. If some script assumes it can call 'shopt' because it's assuming bash is the shell, that's not going to work when zsh is the shell, and that could potentially result in unexpected behaviour.

i'm a zsh user myself, but i've kept bash as the shell for root, due to the above.


And where is this documented? At least on https://wiki.gentoo.org/wiki/Portage I did not see any information about the needed shell. And also invoking emerge from zsh does not show any warning/info/error.

If Portage needs bash, then Portage should start its own bash and also with Portage-specific/defined settings and env vars and not rely that the user did not change "important" bash settings. If I understand the ebuild correctly bash is a dependency of Portage and should be present. But that does not necessarily mean that it should be the login shell.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2201

PostPosted: Fri Sep 13, 2024 5:27 pm    Post subject: Reply with quote

sMueggli wrote:
flexibeast wrote:
sMueggli wrote:
alamahant wrote:
Plz do not use zsh for root.

Why?

Because Portage assumes that bash is the shell, and the differences between bash and zsh can potentially cause issues. One example: bash has 'shopt', zsh has 'setopt'. If some script assumes it can call 'shopt' because it's assuming bash is the shell, that's not going to work when zsh is the shell, and that could potentially result in unexpected behaviour.

i'm a zsh user myself, but i've kept bash as the shell for root, due to the above.


And where is this documented? At least on https://wiki.gentoo.org/wiki/Portage I did not see any information about the needed shell. And also invoking emerge from zsh does not show any warning/info/error.

If Portage needs bash, then Portage should start its own bash and also with Portage-specific/defined settings and env vars and not rely that the user did not change "important" bash settings. If I understand the ebuild correctly bash is a dependency of Portage and should be present. But that does not necessarily mean that it should be the login shell.


Ebuilds are shell scripts. In the specification that shell is specified to be bash, so ebuilds may legally count on bash-specific functions. It's been disputed many times but bash is here to stay. Running emerge under different shells may interfere with the ebuilds and we have seen this numerous times. At leas for your emerge commands, use bash.

Whether portage should start its own bash I can't say, but I guess it's not that simple or it would have already been the case.

Best Regards,
Georgi
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 317

PostPosted: Fri Sep 13, 2024 9:56 pm    Post subject: Reply with quote

sMueggli wrote:
flexibeast wrote:
sMueggli wrote:
alamahant wrote:
Plz do not use zsh for root.

Why?

Because Portage assumes that bash is the shell, and the differences between bash and zsh can potentially cause issues. One example: bash has 'shopt', zsh has 'setopt'. If some script assumes it can call 'shopt' because it's assuming bash is the shell, that's not going to work when zsh is the shell, and that could potentially result in unexpected behaviour.

i'm a zsh user myself, but i've kept bash as the shell for root, due to the above.


And where is this documented? At least on https://wiki.gentoo.org/wiki/Portage I did not see any information about the needed shell. And also invoking emerge from zsh does not show any warning/info/error.


https://wiki.gentoo.org/wiki/Dash

That one says
Gentoo wiki wrote:
As some shell scripts may have "bashisms" in them, dash is not guaranteed to work as a /bin/sh replacement on Gentoo, out-of-the-box.


But there's zero reason to make zsh the root shell and especially not the portage shell.
I love using zsh as my interactive shell, with a ton of customization for my user, but I leave root alone.
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1641
Location: South America

PostPosted: Fri Sep 13, 2024 11:44 pm    Post subject: Reply with quote

sMueggli wrote:
If Portage needs bash, then Portage should start its own bash and also with Portage-specific/defined settings and env vars and not rely that the user did not change "important" bash settings.

I believe that's what happens, indeed, and the reason why sys-apps/portage specifically depends on app-shells/bash.

Ebuilds explicitly allow a subset of Bash constructs according to the Package Manager Specification.

I don't believe which shell is any user's login shell matters for the purpose of using Portage.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 393
Location: Naarm/Melbourne, Australia

PostPosted: Sat Sep 14, 2024 1:03 am    Post subject: Reply with quote

Yes, on the page GDH-gentoo linked to, the PMS specifically states that bash is assumed:
Quote:
The ebuild file format is in its basic form a subset of the format of a bash script. The interpreter is assumed to be GNU bash, version as listed in table 6.1, or any later version. If possible, the package manager should set the shell’s compatibility level to the exact version specified. It must ensure that any such compatibility settings (e. g. the BASH_COMPAT variable) are not exported to external programs.

For EAPIs listed such in table 6.1, the failglob option of bash is set in the global scope of ebuilds. If set, failed pattern matches during filename expansion result in an error when the ebuild is being sourced.

As for the 'Portage' page on the wiki not mentioning this, well, the wiki can't be assumed to be 'complete', and is indeed lacking various bits of information. It relies on people "filling in the gaps" and adding to it more generally, which is why i spend so much time working on it. :-) To give a specific Portage-related example: i recently wanted to set up desktop notifications about emerge progress. At the time, the '/etc/portage/bashrc' page on the wiki didn't describe what env vars were available to bashrc scripts, so i determined that information empirically and added a table to the page. The wiki is what we make it.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20351

PostPosted: Sat Sep 14, 2024 3:54 am    Post subject: Reply with quote

sMueggli wrote:
If Portage needs bash,
It's also not a new phenomenon to *nix. I remember being told not to change the root shell to the otherwise commonly used ksh for a particular environment. If I recall, someone tried and it didn't go well.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 445

PostPosted: Sat Sep 14, 2024 8:50 am    Post subject: Reply with quote

bstaletic wrote:
https://wiki.gentoo.org/wiki/Dash

That one says
Gentoo wiki wrote:
As some shell scripts may have "bashisms" in them, dash is not guaranteed to work as a /bin/sh replacement on Gentoo, out-of-the-box.


I am not talking about replacing /bin/sh or /usr/bin/sh with zsh or any other shell. I am just asking why zsh should not be used as a login shell for user root, especially in the context of Portage.

I also do not want to get rid of bash from my system. I have absolutely no problem with the fact that Portage depends on bash and that ebuilds are using bash-specific functions. I guess that the ebuilds are used in the context of a bash shell, but I doubt that ebuilds are processed directly in the the context of the login shell.

bstaletic wrote:

But there's zero reason to make zsh the root shell and especially not the portage shell.


I had enough reasons to make zsh the login shell for root (I admit the most important reason was "I can"). And in the last few years I never consciously experienced any problems with Portage caused by the wrong shell (and emerge is certainly the most often used command). And now I am asking for reasons why I should revert it.

By the way: emerge is a python script, not a bash script.

A propos script: Running the script
Code:
#!/usr/bin/sh

echo "Script is: $0 running using $$ PID"
echo "Current shell used within the script is: $(readlink /proc/$$/exe)"

script_shell="$(readlink /proc/$$/exe | sed "s/.*\///")"

echo -e "\nSHELL is = ${script_shell}\n"

if [[ "${script_shell}" == "bash" ]]
then
    echo -e "\nI'm BASH\n"
fi

echo "BASH_VERSINFO: $BASH_VERSINFO"
echo "ZSH_VERSION: $ZSH_VERSION"


(basically from https://stackoverflow.com/questions/60844165/definitively-determine-if-currently-running-shell-is-bash-or-zsh) gives different output for
Code:
./shelltest.sh
bash shelltest.sh
zsh shelltest.sh


independently from which shell you are executing the script (I tested it with zsh and bash; sh is symlinked to bash).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum