1

libgcc1和libgcc2的区别

参见:http://gcc.gnu.org/onlinedocs/gccint/Libgcc.html#Libgcc

GCC provides a low-level runtime library, libgcc.a or libgcc_s.so.1 on some platforms. GCC generates calls to routines in this library automatically, whenever it needs to perform some operation that is too complicated to emit inline code for.

Most of the routines in libgcc handle arithmetic operations that the target processor cannot perform directly. This includes integer multiply and divide on some machines, and all floating-point and fixed-point operations on other machines. libgcc also includes routines for exception handling, and a handful of miscellaneous operations.

libgcc是GCC提供的一个低层运行时库,当一些操作/运算在特定平台上不支持时,GCC会自动生成对这些库函数的调用,使用这些库函数来模拟实现。从概念上和源码实现中,又可以分为libgcc1和libgcc2,虽然它们最终会被编译合并为libgcc.a。

参见:http://gcc.gnu.org/ml/gcc-help/2009-03/msg00145.html

libgcc1 exists primarily conceptually. It is the basic set of
operations which can not be reasonably implemented using other
operations. In the good old days libgcc1 was built using the other
compiler on your system. Since these days there is generally no other
compiler, most targets provide assembler code to perform the operations.
For example, see config/arm/lib1funcs.asm.

libgcc1中包含了一套基础操作/运算,这些无法使用其它操作来实现,通常会使用一系列的汇编代码来模拟完成。

libgcc2, conversely, is the set of operations which can be implemented
reasonably. For example, if you have a 32-bit add instruction, it’s
easy to use it to implement 64-bit addition. This code appears in
gcc/libgcc2.c. On many processors it is possible to optimize using
instructions which are not avaliable in C, such as add-with-carry; those
optimizations are written in gcc/longlong.h.

libgcc2,正好相反,这些可以通过已有的一些操作/运算来简单的组合完成。通常是使用C代码来编写。

另参见:http://gcc.gnu.org/ml/gcc/2003-12/msg01191.html

GNU hacker的一些照片

前几天看lldb的 mail list,看见一个Jason Molenda的人的回复。觉得这个名字好像在哪里见过,于是就翻了翻GDB的changelog,发现他在很多年前,给GDB工作过。最开始在cygnus,后来去了apple。无意中在google中搜索了一下,发现了他的一个网站,里边有很多照片。好多照片都是他们这些gnu hacker在一起的,勾起了我无限的兴趣 (我特别喜欢把mail list里边的人和他们的照片对应起来)。下边我来一一介绍,由近及远,

第一个是关于 Richard Henderson http://molenda.us/photos/rth-ildan-test-2005-12-10/ 照片是关于他练习跆拳道的照片吧。Richard 在我心目中是十分牛了,比现在的GCC Global Maintainer要厉害,他现在好像在做qemu。12年在布拉格,我见过他。很cool的一个人。

第二个是 关于Jason Merrill http://molenda.us/photos/wedding-2000-09-16/。 我就认识这个人,他应该是C++ 还是 libstdc++的maintainer。

第三个是 两次GDB picnic 的照片 (1999年和2000年)。http://molenda.us/photos/gdb-picnic-1999/http://molenda.us/photos/gdb-picnic-2000-08-15/ 里边能找到最早的GDB 开发者。大部分人都陆续离开了GDB,只有两个人仍然留着,Stan 和 Doug。看看大牛的样子,的确是很有意思的事情。