Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

[solved] Profile upgrade from 17.1 to 23: error rebuild gcc

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
33 posts
  • Previous
  • 1
  • 2
Author
Message
e8root
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 94
Joined: Fri Feb 09, 2024 3:41 pm

  • Quote

Post by e8root » Mon Mar 25, 2024 3:14 pm

sam_ wrote:We've reported the issue to GCC upstream.
And GCC upstream had a thought: omg, we don't have -march=native test case in our automated test system! :lol:

One small note for everyone now changing -march=native to their CPU architecture by name:
There can be differences between just setting arch to native or specific CPU architecture. When testing it by

Code: Select all

gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
Versus broadwell on my Broadwell Xeon there were few instructions missing and some cache switches.
On Raptor Lake I get almost no switches on raptorlake or alderlake and a lot of them with native.

With Broadwell my understanding is that broadwell has to be as generic as possible and need to work on all CPUs from given family while some CPUs can have instructions which other models from given family don't have hence few instructions were missing. I didn't go and verify instructions which all Broadwell CPUs have to confirm that though.

All in all these things probably won't affect the performance in any significant measurable way but it is just a tidbit which I found interesting to know and therefore worth sharing.
Unix Wars - Episode V: AT&T Strikes Back
Top
sam_
Developer
Developer
User avatar
Posts: 2816
Joined: Fri Aug 14, 2020 12:33 am

  • Quote

Post by sam_ » Mon Mar 25, 2024 3:20 pm

Genuinely, it's kind of fun how many bugs we end up hitting. If you think about it, in the wild, most people are not building applications with -march=x (or if they are, it's maybe one of the x86-64-v* baselines).

I would recommend using app-misc/resolve-march-native, btw.
Top
hujuice
Guru
Guru
User avatar
Posts: 354
Joined: Tue Oct 16, 2007 12:57 pm
Location: Nicosia, Cyprus

  • Quote

Post by hujuice » Mon Mar 25, 2024 4:55 pm

Very clear, and easy workaround.
Those who lack character must at least have a method.
Chi non ha carattere, deve pur avere un metodo.
Top
sam_
Developer
Developer
User avatar
Posts: 2816
Joined: Fri Aug 14, 2020 12:33 am

  • Quote

Post by sam_ » Mon Mar 25, 2024 5:06 pm

Sorry about the hassle, though. I really did try to make it handle it automatically. It just turned out there's some interesting interaction between -march=native and subsequent --param ... so it can't work :(
Top
hujuice
Guru
Guru
User avatar
Posts: 354
Joined: Tue Oct 16, 2007 12:57 pm
Location: Nicosia, Cyprus

  • Quote

Post by hujuice » Mon Mar 25, 2024 6:09 pm

sam_ wrote:Sorry about the hassle, though. I really did try to make it handle it automatically. It just turned out there's some interesting interaction between -march=native and subsequent --param ... so it can't work :(
No, don't worry. Thank you for your work.
Those who lack character must at least have a method.
Chi non ha carattere, deve pur avere un metodo.
Top
e8root
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 94
Joined: Fri Feb 09, 2024 3:41 pm

  • Quote

Post by e8root » Mon Mar 25, 2024 7:19 pm

sam_ wrote:Genuinely, it's kind of fun how many bugs we end up hitting. If you think about it, in the wild, most people are not building applications with -march=x (or if they are, it's maybe one of the x86-64-v* baselines).

I would recommend using app-misc/resolve-march-native, btw.
Yeah, when building world with --emptytree few packages failed rebuild and out of these all were not added by --emptytree.
I managed to build packages failing on my default gcc by using different compilers:
sys-fs/f2fs-tools o2 compiler-clang-lto-full
sys-libs/slang o2 compiler-clang
dev-python/numpy o2 compiler-intel
app-emulation/virtualbox o2 compiler-clang-lto-full

I didn't investigate what is the cause of these build issues yet because for that I will need to first narrow issues to profile change. Maybe it is some other change I made in the meantime... though nothing comes to mind really.
I have another Gentoo install used for testing so I can check it there first making sure to collect some information on these packages beforehand.

Anyways, there was one more package which failed which didn't build on any other compiler and it is www-client/seamonkey
It failed because it didn't like the line /usr/include/math.h:170 and more specifically:

Code: Select all

typedef long double double_t;
conflicting with its own definition of double_t in /var/tmp/portage/www-client/seamonkey-2.53.18.1/work/seamonkey-2.53.18.1/modules/fdlibm/src/math_private.h:34

Code: Select all

typedef double      __double_t;
typedef __double_t  double_t;
I updated seamonkey very recently and it did build so I am pretty sure it has to do with profile change.
Owner of the file /usr/include/math.h is sys-libs/glibc-2.38-r10
So apparently the definition of double_t changed in my system. Another thing to confirm in chrooted Gentoo and collect more data...

Of course the fix was very simple and I only had to create patch file /etc/portage/patches/www-client/seamonkey/double-fun.diff

Code: Select all

diff -Naru to/modules/fdlibm/src/e_rem_pio2.cpp seamonkey-2.53.18.1/modules/fdlibm/src/e_rem_pio2.cpp
--- seamonkey-2.53.18.1/modules/fdlibm/src/e_rem_pio2.cpp	2024-03-25 18:48:53.690475190 +0100
+++ to2/modules/fdlibm/src/e_rem_pio2.cpp	2024-03-25 19:17:14.238418104 +0100
@@ -126,7 +126,7 @@
 	}
 	if(ix<0x413921fb) {	/* |x| ~< 2^20*(pi/2), medium size */
 medium:
-	    fn = rnint((double_t)x*invpio2);
+	    fn = rnint((double)x*invpio2);
 	    n  = irint(fn);
 	    r  = x-fn*pio2_1;
 	    w  = fn*pio2_1t;	/* 1st round good to 85 bit */
diff -Naru to/modules/fdlibm/src/math_private.h to2/modules/fdlibm/src/math_private.h
--- to/modules/fdlibm/src/math_private.h	2024-03-25 19:29:19.833393746 +0100
+++ seamonkey-2.53.18.1/modules/fdlibm/src/math_private.h	2024-03-25 19:15:33.461421487 +0100
@@ -31,7 +31,7 @@
  */
 
 typedef double      __double_t;
-typedef __double_t  double_t;
+//typedef __double_t  double_t;
 typedef float       __float_t;
 
 /*
diff -Naru to/modules/fdlibm/src/s_scalbn.cpp to2/modules/fdlibm/src/s_scalbn.cpp
--- to/modules/fdlibm/src/s_scalbn.cpp	2024-03-25 18:48:53.690475190 +0100
+++ seamonkey-2.53.18.1/modules/fdlibm/src/s_scalbn.cpp	2024-03-25 19:17:19.833417916 +0100
@@ -14,7 +14,7 @@
 double scalbn(double x, int n)
 {
 	union {double f; uint64_t i;} u;
-	double_t y = x;
+	double y = x;
 
 	if (n > 1023) {
 		y *= 0x1p1023;
And this is why I love Gentoo - very useful set of features that enable users to automatically patch source code with whatever changes they want. Including fixing bs build issues only caused by the fact we don't install binary packages like pretty much everyone else :lol:
(I guess now with binpkg's you can skip building from sources for some packages... and hopefully users won't abuse this feature to get out of the build issues...)

EDIT://
Update, Seamonkey fails on 17.1 too. Verified in chrooted environment.
Now I am completely lost as to why it compiled before and now doesn't.
Unix Wars - Episode V: AT&T Strikes Back
Top
hujuice
Guru
Guru
User avatar
Posts: 354
Joined: Tue Oct 16, 2007 12:57 pm
Location: Nicosia, Cyprus

  • Quote

Post by hujuice » Mon Mar 25, 2024 8:13 pm

Nothing failed for me (once -march=my_march).

There is another minor consideration, though.
I'm installing Gentoo on a new laptop, and I've found myself with a stage file tied to a an old profile.
I see that a new stage file is downloadable, now (2024-03-24, mine was 2024-03-17). I hope it's already in the new profile.
Those who lack character must at least have a method.
Chi non ha carattere, deve pur avere un metodo.
Top
pietinger
Administrator
Administrator
Posts: 6630
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Mon Mar 25, 2024 8:56 pm

hujuice wrote:[...] I see that a new stage file is downloadable, now (2024-03-24 [...] I hope it's already in the new profile.
Yes. See: viewtopic-p-8821210.html#8821210
https://wiki.gentoo.org/wiki/User:Pietinger --> New at Gentoo
Top
Post Reply

33 posts
  • Previous
  • 1
  • 2

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic