Sergei Trofimovich
16 hours ago

Today's `gcc` bug is a follow-up to exhausted argument count related to `COLLECT_GCC_OPTIONS` variable:

#gcc #bug

2 days ago

Some gcc background operation clogs my CPU #2204 #gcc

blake shaw
3 days ago

#GCC size: 343Mb*
#Rust size: 1Gb
#GHC size: 1.4Gb
#Clang size: 1.7Gb

#Chez #Scheme size: 5mb

[ * ] all based on the results of using #guix size, removing common and documentation-based dependencies such as ncurses, bash, and zlib

3 days ago

After a successful test with the #glibc libc-alpha mailinglist, the #gcc gcc-patches list is next.

No more From rewriting.

Let us know at Cauldron how well this works then we can apply it to the other patches lists.

GCC - GNU Toolchain
4 days ago

Is the #Linux world witnessing the preparations for another disruption event? A lot of exciting, innovative, new technology is looking for an outlet. #linuxkernel #opensource #opensourcesoftware #rust #rustlang #wasm #gcc #llvm #gnu

4 days ago

gcc error on Ubuntu 22.04 #2004 #2204 #gcc

Sergei Trofimovich
6 days ago

Did not see `gcc` bugs for almost a month.

Today's `gcc` bug is an infinite recursion in a `gimple_zero_one_valued_p()` predicate:

#gcc #bug

1 week ago

@Tanuki These utilities are all small side projects for a single developer. Writing a modern shell is barely within reach, and fully replacing #GCC would require a huge investment, even if you start from #LLVM.

I heard that Google and Apple have pulled resources from #Clang a few years ago, and that's why #Cpp support seems to be falling behind GCC:

1 week ago

Not to mention #GCC, a marvel of compiler design, with multiple language frontends, portable to dozens of host platforms and targeting hundreds of architecture variants 🤩


2 weeks ago

Ubuntu on wsl always "fails to fetch" whenever I'm trying to download to it. How can i fix this? #updates #dns #windowssubsystemforlinux #gcc

Iran News 🤖
2 weeks ago

RT by @amalizadeh: The @EUSR_Gulf, Luigi DiMaio is paying a visit to #Tehran.

Important signal in line of #EU‘s goal not to confine its #Gulf strategy to #GCC states.



Dani (:cxx: modules addict)
2 weeks ago

@PeterSommerlad It does.

In this particular case, MSVC rejects one version of invalid code and incorrectly accepts the other. And I even totally understand why: the Modules TS had a different grammar.

Both Clang and gcc are even worse: they accept *both* ill-formed variants. And they don't have the "legacy" excuse.

#clang #gcc #msvc

@argv_minus_one @retronianne and even the #GNUtils are replaceable - and that is a good thing.

In fact if #clang / #LLVM support would be where it should be, I'd even ditch #GCC for OS/1337...

waiting for gcc to finish updating


pablo escobar waiting meme
2 weeks ago

ld: library not found for -lgsl #compiling #gcc

there was
no way to guarantee that more than one cache line was simultaneously in the
cache. Thus anything ATOMIC is restricted to a single cache line.

This also lead to my SAF (advanced synchronization facility) at AMD that
I have further refined into ESM (Exotic...method) that allows up to 8
cache lines to participate in an ATOMIC event, with guarantees of forward
progress, and ways to avoid future interference. One of which has the
property that it converts a BigO( n**3 ) problem into a BigO( 3 ) problem
{yes there is no n in the second BigO number}.

Say a timer goes off and the OS enables K threads, each of these threads
accesses the front of the work queue and all see interference, on the
second pass they also all see interference, but go out and ask why they
are seeing interference. This time they all get back a unique number, and
can use this unique number to access the work queue without interference.
This problem is intertwined with the cache coherence protocol, bus protocol,
and bisection bandwidth of the "bus". So it cannot be managed by the processor
at a fundamental level. Besides, does any GBOoO processor want to sit in a
loop asking
It's a sequence of atomic operations, none of
which should ever fail, but some of which might be delayed, and there
would be a potential benefit to signaling the application that a delay
larger than some determined value exists, and the application can be
signaled so it can decide what to do when the resource is not immediately
available. In other cases where it just needs to take place at some
point, then the pauses on each core to attain a full lock on the re-
sources mean it will be slower, but still fulfill the needs of the app.

And in the case of these multiple single atomic operations executed in
succession, they also would never fail unless there is some need for them
to be executed sequentially without delays. And I'm still considering a
possible way to implement that design, so that the full multi-transaction
can be done atomically through a protocol that indicates how many trans-
actions are in flight, which locks down resources for that duration,
taking a hit on all cores' performance, but ensuring fully atomic op-
eration when needed.

#riscv only has a single (64-bit) load/store-reservation
capability, the semantics of which is that the SC succeeds if and
only if there was no other SMP core / hardware-thread that requested
the exact same memory address in the intervening time. it is
intended that a loop occur around this testing of the return result
from SC, retrying the LR/SC batch until it succeeds.

the question therefore came up, well, is it reasonable to have
multiple consecutive LR instructions make multiple cache-line
reservations, followed by multiple consecutive SC instructions?
and for the semantics to be "all-or-nothing" on a global basis.
i.e. a sequence of LR reservations are made, and if another
SMP core / hardware thread makes a reservation on *any* of that
batch, then *all* LRs are invalidated (not just the one).

the same looping would therefore be required: it would just be
the case that several memory addresses in completely different
locations could be reserved simultaneously.

i would be interested to hear peoples' thoughts on whether this
is practical to implement, and, more importantly, if it would
actually be useful.

in particular, the fact that now *multiple* things happen inside
the multi-LR, multi-SC loop has me concerned, as i do not have
enough experience in algorithms to say if that is a problem
a multi-LR/SC, that intrinsic could reasonably be
expected to have an augmented equivalent that, instead of a single
memory address, takes an array of memory addresses.

as long as the same array of addresses is passed into both the LR and
to the SC, the specification is adhered to.
LR/SC allows the program to *detect* if anything
(specifically, another SMP core or hardware-thread) *interfered* with
the updates, such that *after* the updates have been carried out and
the interference [guaranteed to have been] detected, the operation
may be repeated again and again until such time as it is detected that
no interference occurred.

the single-LR/SC case been successfully implemented by multiple RISC-V
vendors, and it does have full, proven, working compiler support in
#gcc, as well as libc6 (glibc) support.

so the question is: can a multi-LR/SC with multiple memory reservations
just like mitch's 66000 ISA work as well?
in the riscv linux kernel as well as the supervisor-mode riscv
unit tests, such a context switch is done in a traditional way of
saving all registers onto an [altered] stack (and other state). the
unit test code is a lot simpler than a full OS-style context-switch:

Javier Salcedo
3 weeks ago

My inner “clean” coder is very happy to see that making an already small function even smaller made it x4 faster because GCC started to inline it (“Other lessons learned” section).

On the other hand this is something I wouldn’t have expected and it horrifies me.

#Cpp #GCC #CleanCode

Felix Palmen 📯
3 weeks ago

@alexr If some "irrelevant" bits in some pointers used by the compiler at runtime change the compiled code, that's some strange compiler bug. Not that they're unheard of, sure, but I now see your question boils down to whether using the #FreeBSD kernel instead of #Linux would trigger bugs in #GCC.

Again, checking this would be a *huge* amount of work. You might think you could at least compare the object-code files easily, but even these are influenced by library headers, they might pull in types with sizes changed between versions, they might even use conditional compilation based on library versions, etc (and yes, that's all "changed compiler input").

To really do this check reliably, you'd have to create the exact same toolchain and used libraries on both systems.

I'll rather focus on getting more software to build/work, so I can finally test some closed-source software... time is limited 😉

C++ on Sea
4 weeks ago

So, You Want to Use C++ Modules … Cross-Platform? – by @DanielaKEngert – C++ on Sea 2023
#clang #cpp #cppmodules #gcc #MSBuild #programming

4 weeks ago

How to set enviroment to use older gcc g++ version without changing default? #2004 #gcc #csh

Giovanni Crisalfi
4 weeks ago

I never wrote Assembly in my life, but tonight (for some reason) I thought of disassembling simple C code snippets with Ghidra. So, I started with a hello world and was very surprised to find a much more extensive and complex result compared to my original assembly (obtained with GCC).

I mean, it's a Hello World!

#ghidra #gcc #clang #assembly #asm

Screenshot of Ghira window

Assigning your copyright to the FSF helps defend the GPL and keep software free. Thanks to Gene Goykhman, Sergey Alexandrovich Bugaev, Wang Diancheng, Warren Thomas Everett Wilkinson, and Xinyuan Zhang for assigning their copyright to the FSF! #GNU #Emacs #glibc #GDB #GNUstep #GNUHurd #GNUMach #GCC Learn more at #CopyrightAssignments

1 month ago

Why is this bus error occurring when reading through a shared memory object? #kernel #2204 #gcc #memoryusage #shm

1 month ago

I love that they put "usually" in this sentence:

"Humans usually are not as good writing machine code as they are at writing Fortran"

About GNU Fortran

#gcc #gfortran #fortran

Felix Palmen 📯
1 month ago

Added these symlinks.

#glibc needs some "convincing" to install *everything* to /usr, but it works.

It solves the issue on #aarch64 and #i386 (which both install the program interpreter to /lib by default).

It does NOT solve the issue on #amd64, where the program interpreter is installed to /lib64, but *something* during #GCC build insists on finding it in /usr/lib instead. 🤯

Trying a hack with a hardlink now (after learning that glibc's ldconfig just deletes symlinks to the program interpreter).

Felix Palmen 📯
1 month ago

And I still have NO idea where these errors regarding the ELF program interpreter come from when building #gcc and its libstdc++. They do NOT appear in the build log, they are somehow just spit to the controlling terminal of #poudriere. And I didn't find anything not working in these packages so far ... 🤯

tiny #nix tips for avoiding collision if your get them with home-manager or globally
your packages need be disjoint sets
case in point strings part of #gcc and busybox is common and there is collision
so you need know your package before you fetch it , until then use a shell or local env

1 month ago

Compilers Mastodon, does anyone know of examples where major C compilers exploit UB of misaligned loads/stores to produce silent misbehavior?

That's excluding
- Generating instructions that trap if misaligned (e.g. x86 movdqa), because that's not silent.
- Exploiting code that does more than just making misaligned loads/stores, such as calling __builtin_assume_aligned.

(cc @regehr... hmm, who else should I cc. I wish Mastodon had search. #compilers #llvm #gcc)

Sergei Trofimovich
1 month ago

Today's `gcc` bug is a case where `gcc` stopped recognizing some `avx2` primitives on `avx512` code (all on `highway-1.0.6` code again):

#include <immintrin.h>

#pragma GCC target("avx512vl,avx512dq")

void bug(__m256i i) {
volatile auto v1 = _mm256_cvtepi64_pd(i);

and failed as `error: inlining failed in call to 'always_inline' '__m256d _mm256_setzero_pd()': target specific option mismatch`

#gcc #bug

Sergei Trofimovich
1 month ago

Today's `gcc` bug is where `gcc` generated wrong code for `highway-1.0.6` library in `-mavx2` mode.

When handling the following loop:

u8 in_lanes[32];
for (unsigned i = 0; i < 32; i += 2) {
in_lanes[i + 0] = 0;
in_lanes[i + 1] = ((u8)0xff) >> (i & 7);

`gcc` broke `i =12` iteration and instead of `i[13] = 0xf;` (`0xff >> 4`) stored something like `i[13] = 0xef;` there.

#gcc #bug

Lawrence Murray
1 month ago

This idea of instantiating C++ templates with std::variant turns out to be more complicated than I thought once compiler optimizations are enabled, but function attributes provide the fix. The example code now looks like this. Full write up here: #cpp #cplusplus #programming #clang #gcc

Example C++ code:

#include <variant>

#if __has_attribute(noipa)
#define KEEP __attribute__((used,retain,noipa))
#define KEEP __attribute__((used,retain,noinline))

template<class T, class U>
KEEP void test(T x, U y) {

KEEP static void instantiate() {
  std::variant<double,float,int> x, y;
  std::visit([]<typename T, typename U>(T x, U y) {
    if constexpr (!std::is_same_v<T,U>) {
      test(x, y);
  }, x, y);
Felix Palmen 📯
1 month ago

How often do you have to build #GCC to have a *native* version for #Linux when building on #FreeBSD?

The answer is: 3 times. First a minimal cross-version without #glibc, required to actually *build* glibc. Then, a "full" cross-version using that glibc. And finally, using this full cross-version, the *native* version.

How often do you have to build GCC to find and fix issues in your FreeBSD ports for these 3 stages? The answer is: *countless* times. And it really takes time to build 😞

Felix Palmen 📯
1 month ago

@thindil That's what I assume as well, once I'm done with the toolchain, architecture-specific differences should be rare (if encountered at all). 🙏

Just finished the cross-version of #glibc for all archs. Two more (#binutils and #gcc) to go for the FULL cross-toolchain. That will be the goal for today, the native toolchain maybe tomorrow 😎

Felix Palmen 📯
1 month ago

Well ... no, building with #gcc didn't help.

Turns out the issue were #ELF relocation types. I have no idea why #Linux needs them *just* to build the headers (which is all I need for #Linuxulator, cause the actual #kernel will *still* be #FreeBSD), but yep, one type is named slightly differently: R_X86_64_JUMP_SLOT on Linux, R_X86_64_JMP_SLOT on FreeBSD. It has the same value, 7, so for now I just hardcoded it in the port Makefile for the Linux headers. 🙈 (hey, it works 🤷‍♂️)

Felix Palmen 📯
1 month ago

Trying to get this to the other archs supported by #FreeBSD's #Linuxulator (amd64 and i386), I'm hitting yet another wall: #Linux headers fail to build there. Oh freakin hell, I expected to do quite some adaptions to support all 3 archs, but I didn't expect it to fail at *this* stage 🤯

Already tried to understand what happens in Linux' build system. Well, it's not exactly easy to understand 🙄

Shot in the dark, trying it with #gcc (instead of the base #clang) now... (which will take a while cause my test machine has to *build* this gcc first, bah ....)

1 month ago
Sergei Trofimovich
1 month ago

Today's `gcc` bug is where `gcc` generates wrong code for `linux/perf` tool. Latest `gcc-13` release is also affected.

There `gcc` removed required NULL pointer checks. It is somehow tickled by the fact that pointer is dereferenced later (-O3, loop and -fno-strict-overflow):

struct dso * dso = NULL;
// should exit here
if (!dso) return 1;

int *a = &dso->maj;
if (!(a && *a)) __dso_id__cmp_();

`gcc` just removes `if (!dso) return 1;`.

#gcc #bug

Felix Palmen 📯
1 month ago

Indeed, sanity-checking the new #Linux-native #GCC for #FreeBSD's #Linuxulator shows it works perfectly fine at least for C, and using static #libgcc (because I removed the file, should really be packaged separately) 🥳

So, to complete the toolchain, next steps will be separate ports for libgcc and libstdc++, should be possible to build these with this native gcc, we will see!

Felix Palmen 📯
1 month ago

Another little update on this endeavor .. native #Linux #GCC for #FreeBSD's #Linuxulator finally builds! 🥳

Still needs some "love" in detail (like, correct path for man files).

And also, I have to find a way to package #libgcc separately, cause most software built for Linux using GCC will need it, and it doesn't make sense that everything pulls in the whole GCC as a dependency ...

Well, maybe tomorrow then 🙈

Felix Palmen 📯
1 month ago

We have #glibc, #zlib, #binutils, #gmp, #mpfr and #mpc ... in theory everything needed to build a full-featured native #gcc for C and C++. Oh wow. Now, trying to create *this* port 😎

Edit: My hope is that with the --sysroot option (set to ${LINUXBASE}), this new toolchain will only ever look for libraries inside ${LINUXBASE}, avoiding weird build issues you might get when using the existing linux-c7-devtools port. Well, I'm not sure I fully understand this --sysroot magic 🙈

Felix Palmen 📯
1 month ago

I'm carefully optimistic now again 😎

After first building very basic/limited "-bootstrap" versions of binutils and gcc into a separate prefix, it seems I could finally build a complete #GNU cross (#FreeBSD -> #Linux) toolchain, including #binutils, #glibc and #gcc (with libstdc++). This final cross gcc at least passed the most basic sanity check -- it successfully compiles an empty program 🙈

Now doing a bit of cleanup and then trying whether this beast is able to build the *real* (native) glibc for a new #Linuxulator userland 😎

Felix Palmen 📯
1 month ago

@thindil Oh there *is* binary compatibility for sure. The #Linux kernel typically doesn't break its userspace-facing #ABI. #Glibc and #GCC's libstdc++ use symbol versioning to provide backwards compatibility.

The issue starts with all the other libs, there's no standard for some "base" GNU/Linux system. That's where all these (IMHO damn broken) ideas like #AppImage, #Flatpak etc come from. Of course, you could just link statically instead, seems people don't get that any more 🙈

Anyways, quite some binary #Linux software will work "anywhere" as long as the required libs are not too old (looking e.g. at browsers...). And having a #Linuxulator userland built from source *should* enable you to just add ports for missing libraries. Well, in theory 🙈

Felix Palmen 📯
1 month ago

@thindil I can certainly use #FreeBSD "tools" (gmake, bison, gettext, whatever) for building this cross-toolchain. But indeed, for libraries, they need to be built targeting #Linux. And because #GCC with the full feature set needs e.g.#glibc when targeting Linux, but then you need GCC to *build* glibc, I need at least some "bootstrapping" ports. It's really a mess.

Once I have a full-featured cross GCC targeting Linux ready, I'll stop for a while to party 😂

Felix Palmen 📯
1 month ago

I really don't get it. I *had* a working port building "some" (with lots of missing features, e.g. threads) cross-#gcc (build: #FreeBSD, host: #Linux). Now I try to build this same port in some separate PREFIX and, it fails 😞

GCC - GNU Toolchain
1 month ago

Designing a formal Security Policy for #GCC. FYI Fuzzing GCC and DoS GCC are not considered security vulnerabilities, sorry.

GNU Spotlight with Amin Bandali: Ten new GNU releases in the last month including #GCC, #GPG #Parallel, #Tramp, and more. Full details: Big thanks to @bandali0 @bandali, all the devs, and other contributors! #GNUSpotlight

Andrew Tropin
2 months ago

A book on compilers. Free for personal use:

I would also like to share Compiling with Continuations, but it's not free available.

#book #books #compiler #compilers #llvm #gcc

Ken Brucker
2 months ago

Interesting #C problem…

Any way to flag the following contrived scenario as a conversion warning in #gcc?

ssize_t result = -1;
if (result > sizeof(result)) printf(“-1 is bigger\n”);

In my testing of the various -Wconversion options, none will flag this as a possible problem. Comparing an int and an unsigned int does not seem to be caught but assigning one to the other is in all my testing.

2 months ago

Unable to link C source code with ADA static library (Error: libnewapi.a(unit1.o):unit1.adb:undefined reference to `__gnat_rcheck_CE_Overflow_Check') #ada #programming #linker-errors #gnat #gcc #ada #c

@gamingonlinux This is why Distributions like #AlpineLinux and #ChimeraLinux / @chimera_linux actively remove & replace #GNUtils and work to get #Linux built by #LLVM / #Clang instead of #GCC...

Even I do want to yeet tools out of my workflow...

But @ncommander went into the details re: #RMS!

@yura @torvalds hey, that's unfair...

The #Kernel actually makes the least problems...

it's shit like #GCC that constantly bricks the entire userland with a minor #update!

3 months ago

I guess now that I'm figuring out this platform I should do an #introduction

I'm a #pagan #witch and #druid who just married my husband, @CaptainSharky, late last year. We also have two rescue #cats. My pronouns are she/her and I have a #history degree and work as a substitute teacher. I'm also a #barbershop #chorus singer (though I'm on break from that right now) and a #501st volunteer costumer.

My spouse and I regularly attend conventions and enjoy #anime #cosplay #videogames #gaming #boardgames #dnd #jeeping #hiking and #zumba. I also enjoy #manhwa #manga #reading #curlyhair care and #weightlifting. I'm also a #furry!

I consider myself a #gaulishpolytheist, French-American Folk Practitioner, and #cottagewitch. I'm an #AODA (Ancient Order of Druids in America) Candidate, a #GCC (Gnostic Celtic Church) Novitiate, and an #ADFdruidry (A Druid Fellowship) member.

#witchcraft #folkwitch #frenchfolkwitch #paganism #druidry #teaching #education #costuming #colorado #starwars

📸 CW: direct eye contact, prop weapon

A collage of photos. Top left is of two individuals wearing Star Wars Snowtrooper costumes in the snow, top right is of an art badge depicting a cartoony deer with the name "Leena", bottom left is of the two Snowtrooper individuals with their helmets off posing with Hayden Christensen, middle left bottom is multiple photos of a chorus performance and attire, middle right bottom is of a handfasting wedding, and the bottom right is of two gray cats.
Csepp 🌢
3 months ago

#TIL that #LLVM could have been merged into #GCC under a #GPL license.
Tbh everyone who is serious about #copyleft / #FOSS should learn from the fatal mistake that was the anti-modular-GCC stance of RMS, lest history be repeated.

GNU Spotlight with Amin Bandali: Twelve new GNU releases in the last month, including #GCC, #GnuPG, #R, and more. Full details: Big thanks to @bandali0 @bandali, all the devs, and other contributors!

Andrew Tropin
4 months ago

#gcc fun

Do you know that "-funsafe-math-optimizations" doesn't stand for "fun, safe, math optimizations"?

@marcan this reminds me how #Linux also was the first #OS to run on #Itanium and how the #GCC is even the best compiler for that architecture - even better than #Intel's own!

But yeah, the only thing that would make @AsahiLinux even faster on #AppleSilicon would be if compiling stuff would be done entirely in RAM wherever possible, leveraging 10x->1000x more IOPS and lower latency.

#GCC 🤝 #DaVinciResolve
Builds 100-200 Mb output by 4+ hours

4 months ago

i have a number of #zines in progress about the great garbage continuum: the great cosmic flow of garbage, where things move from being "materials" to "useful" to "junk" to "gross" and then onward..

we are all in the great garbage continuum. the relationship b/w the cycle of life & the gcc is very complex.

anyway, i keep getting more zine ideas about it, like "with all projects, start them with the understanding that you'll eventually have to clean it up."

#gcc #garbage #trash #ecology

one view of the great garbage continuum
4 months ago

i have a number of #zines in progress about the great garbage continuum: the great cosmic flow of garbage, where things move from being "materials" to "useful" to "junk" to "gross" and then onward..

we are all in the great garbage continuum. the relationship b/w the cycle of life & the gcc is very complex.

anyway, i keep getting more zine ideas about it, like "with all projects, start them with the understanding that you'll eventually have to clean it up."

#gcc #garbage #trash #ecology

Ron Bowes
7 months ago

#TIL you can get the return address or frame base in #gcc, which can be handy when making a CTF challenge!

Dr. Brian Callahan
9 months ago

A wild #blog post appeared!

Did you know that #GCC just added Modula-2 and #Rust frontends to mainline? Come with me as I explore how well they work on #OpenBSD. (Spoiler: excellently out-of-the-box.)

As an added bonus, there are instructions in the blog post for how you can get your own GCC with Modula-2 and Rust on your own OpenBSD machine. Just a quick pkg_add away!

#compiler #compilers #opensource #freesoftware #FOSS #FLOSS #OSS #FreeBSD #NetBSD #DragonFlyBSD #BSD #Unix #Linux

Guillaume Gomez
9 months ago

My first commit (written with antoyo) was merged in GCC! \o/

It allows us to continue improving the GCC backend for the Rust compiler ( without needing a custom libgccjit version. :)

#rustlang #gcc

Jed Brown
10 months ago

Wow, #gcc documentation is live with #sphinx #furo. 😍