[Prev][Next][Index][Thread]

Re: Overriding stuff from OSKit libs, some random remarks, and patches



Ramon van Handel <vhandel@chem.vu.nl> writes:

> Well, here's an idea:  perhaps all OSKit symbols should be declared
> "weak" using __attribute__((weak));  From `info gcc`:
> 
> `weak'
>      The `weak' attribute causes the declaration to be emitted as a weak
>      symbol rather than a global.  This is primarily useful in defining
>      library functions which can be overridden in user code, though it
>      can also be used with non-function declarations.  Weak symbols are
>      supported for ELF targets, and also for a.out targets when using
>      the GNU assembler and linker.
> 
> As the OSKit's goal is to povide only the things you need, and to let
> you do others, I think making all OSKit symbols weak would make sense.

Good idea!

> This does require, though, that all of the OSKit headers are modified.
> It's a pity that the OSKit doesn't use a prototyping macro like GNU's,
> because then all of the symbol declarations could be changed using
> one #define.

Maybe it would be quicker to enhance the linker with a new flag that
says, ``the following objects/libraries only define weak symbols'' --
but I'm not going to do that work. ;)

> > A few other minor problems I stumbled over:
> > 
> > When building the OSKit by doing a "make" in the top-level directory,
> > the make process sometimes aborts with a terse message similar to
> > "make: Aborted".  Just restarting "make" finishes the build process.
> > Any idea what's causing this?
> 
> Do you also get signal 11's from GCC ?

I'm not sure what the "Aborted" message means exactly... there is no
message saying a signal is the reason for the abort, and the problem
occurs rare enough to make trying to reproduce it a pain.

Michael
-- 
hohmuth@innocent.com, hohmuth@inf.tu-dresden.de
http://home.pages.de/~hohmuth/

References: