Skip to contentSkip to conversation

Kernel ABI headers step #1: Gathering information

DISCUSSION Kyle Moffett 1 participant 2 messages Sep 13, 2005

lore
Share & tools
lore
#0 lore raw

As part of the kernel ABI headers project, I need to gather information on what GCC provides on a variety of architectures and configurations. I am looking for people with a variety of architectures and distributions to run the script below and (privately, please, no need to flood the list!) email me the output. I'm only interested in archs supported by linux, obviously :-D. This should help me to see if there are any global CPP features that can be relied upon across the whole spectrum. If you have any especially obtuse GCC/platform combination, I would really appreciate it if you could do this, as otherwise I'm unlikely to be able to locate all of said GCC combinations. (The reason I get the kernel version is so I'm able to tie GCC archs to kernel archs). Once I've got a decent database of per-arch features/macros/etc, I'll try to post it online somewhere for all to access. Thanks for all your help!

Cheers,
Kyle Moffett

--
There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.
-- C.A.R. Hoare

#! /bin/sh

echo "Linux kernel version:"
uname -a
echo
echo
echo "GCC version:"
gcc -v
echo
echo
echo "GCC predefined macros:"
echo | gcc -E - -dM | sort

#1 lore raw

The script I posted contained a semi-bug such that if someone didn't capture standard error, they would be missing the GCC version in the log. Here's a fixed version (Thanks to Keith Owens for pointing this out!)

Cheers,
Kyle Moffett

--
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
-- Brian Kernighan

#! /bin/sh
echo "Linux kernel version:"
uname -a
echo
echo
echo "GCC version:"
gcc -v 2>&1
echo
echo
echo "GCC predefined macros:"
echo | gcc -E - -dM | sort