This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pthread_cond_* does not compile on i386

On Mon, May 5, 2008 at 10:01 AM, Gilles Carry <> wrote:
> > This is not true. Did you read this somewhere?
>  I asked this on libc-alpha. The answer was:
>  >Is asm code supposed to do exactly the same as C code?
>  of course ... things would be broken otherwise
>  ...

The C file normally includes headers that define some basic NPTL functionality.

In theory the same headers should be included in the asm
implementation, since the .S files are compiled as assembler-with-cpp.

The use of the __ASSEMBLER__ macro allows one to write macros that
work in C or asm.

>>> Should C code be the reference? Should asm be modified only when we are
>>> sure C is ok? It is a problem when people change asm code without updating
>>> the underlying C files.
>  you should modify whatever your target platform uses

That's a vague response. The C code tries to be the generic reference,
but can't always in the case where the feature can't be implemented
completely in C (or safely given an optimizing compiler). The generic
C code is going to be used by targets that don't override the C file
with an asm file, so yes, it should be modified first. I would then
build and test on a target that uses the generic C file. Next you
probably want to adjust the asm that implements the C file for your
target, and test again.

Does that explanation help?

> > At one point the generic C code probably worked, but after the asm
> > files were written nobody bothered to build without them. As time
> > passed it bit rotted.
>  It's a pity.

The generic C code works, but it's the i386 target that is probably
missing some of the C file implementations of certain macros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]