Aldy Hernandez

Aldy travels the world while hacking on free software. He has been contributing to the GNU compiler suite for almost two decades, from every continent except Antarctica. When not glued to the computer screen, he's usually out riding bikes.

Recent Posts

Improve your code: Tales from confinement without a debugger

Improve your code: Tales from confinement without a debugger

I have always been impressed by developers who make do without a debugger, and have often wished I could be more like them. I vaguely recall a colleague saying he never used a debugger, favoring printf over gdb. Also, in my rookie years, I vividly recall chasing a kernel bug with a friend who was using objdump and the source of a much older kernel:

“Richard, shouldn’t you at least use the correct source?”
“Meh … they’re close enough.”

I’m still impressed.

Now that I have coded for some years, I’ve noticed that I have picked up some bad habits along the way. Over-dependence on the debugger is one of them. I often use it as a high-powered crutch, which frequently leads me waist-deep into stack traces, rarely stopping to think things through. I get lost inside 20 levels of recursion and wonder why an irrelevant variable is being tickled.

Granted, there are many good uses for a debugger, but I’m at 40% on the good use scale. My uses usually start benign but then degrade into cancerous abstractions. So, for my 20th GNU Compiler Collection (GCC) hacking anniversary, I decided to give myself the challenge of one month without a debugger. Here is the tale.

Continue reading “Improve your code: Tales from confinement without a debugger”

Share
A gentle introduction to jump threading optimizations

A gentle introduction to jump threading optimizations

As part of the GCC developers‘ on-demand range work for GCC 10, I’ve been playing with improving the backward jump threader so it can thread paths that are range-dependent. This, in turn, had me looking at the jump threader, which is a part of the compiler I’ve been carefully avoiding for years. If, like me, you’re curious about compiler optimizations, but are jump-threading-agnostic, perhaps you’ll be interested in this short introduction.

Continue reading “A gentle introduction to jump threading optimizations”

Share
Diagnosing Function Pointer Security Flaws with a GCC plugin

Diagnosing Function Pointer Security Flaws with a GCC plugin

A few months ago, I had to write some internal GCC passes to perform static analysis on the GNU C Library (glibc). I figured I might as well write them as plugins since they were unlikely to see the light of day outside of my little sandbox. Being a long time GCC contributor, but having no experience writing plugins I thought it’d be a good way to eat our own dog food, and perhaps write about my experience.

Continue reading “Diagnosing Function Pointer Security Flaws with a GCC plugin”

Share
Bootstrapping POWER8 little endian and common pitfalls

Bootstrapping POWER8 little endian and common pitfalls

gnu logoEarlier this year I was asked to bootstrap our core tools (compiler, assembler, linker, and libraries) from the ground up, to help the rest of the team in providing enough infrastructure for bootstrapping an entire OS to POWER8 little endian.  Since I spend most of my days working on the upstream development of the GNU Compiler Collection (GCC), prior to this project I hadn’t actually worked much with either RHEL’s development processes or RPM as a whole.  So leading our effort to bootstrap the tools onto a new architecture required a lot of coming up to speed.

Not being one to shy away from learning an entire new infrastructure, I accepted, and so began a 6 month ordeal fighting with everything from the assembler to GNU Emacs. Having learned so much from this project, I thought it would be good to write some of it down, both for the curious, and to help in future bootstrapping efforts.

Consequently, I’d like to give an overview of how an OS is bootstrapped, and what insights I’ve learned that can help developers in designing packages that are easy to bootstrap and bring up in new architectures.

Continue reading “Bootstrapping POWER8 little endian and common pitfalls”

Share