[WIP] Fix more if.h issues with glibc and the linux kernel.

Carlos O'Donell carlos@redhat.com
Tue Apr 3 17:15:00 GMT 2018


Jose,

Attached is my WIP patch for fixing more of the if.h issues with the linux
kernel headers.

I would like to see the work in this area have 3 key properties:

1. Harmonization:

   There should be changes to glibc *and* the linux kernel to ensure that
   the API/ABI stays as close to the same as possible regardless of the
   header inclusion ordering.

   To achieve this you need to get patches into both glibc and linux
   kernel headers.

2. Isolation:

   The changes should live in libc-compat.h to isolate the coordination
   issues to just one file you have to change for each C library.

   There have been other proposed plans from musl, but I have yet to see
   a complete proposal from Rich which addresses my concerns and *experience*
   that we have users including headers in both directions and that this
   deserves consideration for the sake of users. There has been recent
   activity in this area upstream but I haven't had time to review.

   Note: I think the xattr.h fixes were flawed in that they are not well isolated.
   Isolation makes it easier to update all the libc-related logic and keeps
   the headers themselves clean. So these are not a good example.

3. Testing:

   Add test cases which compile with headers in both orders as I've shown
   in my WIP patch. I tried initially to do a compile-time test framework
   but Joseph Myers did not think it was worth it and it was actually hard
   to bend the existing build system to that, so this is just easier.

Please find attached my WIP patches.

I don't have the time to drive this forward right now, but if this is something
that is impacting Oracle, please feel free to move forward with these patches.
Please also feel free to throw all of this away if you think there is a better
way to do this.

Please update the wiki "Synchronizing Headers" if you make progress or have
updated state on which headers work and against which commits:
https://sourceware.org/glibc/wiki/Synchronizing_Headers

Lastly, I think it is the *wrong* approach to randomly test header inclusion
ordering, we need to be tactical and cleanup the common headers used together.

-- 
Cheers,
Carlos.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kernel-header-issues.patch
Type: text/x-patch
Size: 1342 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20180403/5a51f752/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-if.h-header-ordering-issues-with-testing.patch
Type: text/x-patch
Size: 24394 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20180403/5a51f752/attachment-0001.bin>


More information about the Libc-alpha mailing list