fix: Move gnulib/lib/error.h to gnulib-error.h#23
fix: Move gnulib/lib/error.h to gnulib-error.h#23blorente wants to merge 5 commits intojmillikin:trunkfrom
Conversation
|
I'm not opposed to the feature as stated, but for the specific case of gnulib shadowing the global system That approach would also be easier to maintain from a cross-platform perspective, since it would work the same regardless of compiler or system libc. Note that |
I don't see the same thing, In my compilation gnulib is included as an Whatever the reason, I think the solution you presented is worth a shot. The risk there is that the headers from libc6 introduce some symbol that they shouldn't, but it seems like a small risk. |
To avoid being shadowed by other error.h headers like the one from libc.
774f5ac to
4fa3d19
Compare
4fa3d19 to
17408f9
Compare
|
@jmillikin I've made the changes and confirmed that it works with our use case. I'll fix the CI failures in a moment, but please let me know what you think. |
This is just an early attempt, you can probably think of a better way to fix it.
The problem I'm trying to solve: For good reasons, our gcc toolchain includes
libc6with-isystemon compilation.libc6has a header, callederror.h, which is guarded with the guard_ERROR_H.M4's gnulib also has a header called
error.hwith the same guard. Becauselibc6comes before gnulib in the-isysteminclusion order, we don't get the symbols from gnulib'serror.h. Fun.The solution we're using in the meantime is to add
-I <path/to/gnulib>to the extra copts, because-Iresolves as "last one wins", so gnulib gets picked up first: blorente@6238498#diff-64fffd7f2fee0a5a182cc297f3c260f7820729dd4f2855c52aeac25fa5d65271R37-R46We'd like to avoid maintaining this patch, and instead rely on
extra_copts. However, because we shouldn't depend on canonical names, we need to inject the repository name.As I said, this is just an early attempt, happy to modify it to whatever suits you.