[U-Boot-Users] PATCH: include/linux/byteorder/swab.h

Fixes: o the optimization can now be disabled (config.mk: OPTFLAGS = -O0) (makes debugging easier) Change: o changed extern __inline__ into static __inline__ in include/linux/byteorder/swab.h
COMPILER: ELDK x86 2.1.0 (RedHat 9.0)
BUILD FOR: ppc mips arm
BUILD STATUS: ERIC FAILED ixdp425 FAILED lubbock FAILED MPC8540ADS FAILED MPC8560ADS FAILED
NOTE: the same builds fail for U-Boot HEAD branch.
-- Best Regards, Leon.

In message 1071237953.30434.196.camel@tt-devel.ultra.si you wrote:
Change: o changed extern __inline__ into static __inline__ in include/linux/byteorder/swab.h
Sorry, but I reject this patch. Using "extern __inline__" serves some useful purpose (see GCC documentation). Also, this is how it is implemented in Linux, too.
Best regards, and a Happy New Year!
Wolfgang Denk

Hi Wolfgang,
On Sat, 2004-01-03 at 20:57, Wolfgang Denk wrote:
In message 1071237953.30434.196.camel@tt-devel.ultra.si you wrote:
Change: o changed extern __inline__ into static __inline__ in include/linux/byteorder/swab.h
Sorry, but I reject this patch. Using "extern __inline__" serves some useful purpose (see GCC documentation). Also, this is how it is implemented in Linux, too.
I read the documentation and it says that if you use extern and __inline__ together, the function has to be _ALSO_ implemented in a library - which is not true for U-Boot.
I do not wanna be rude, but I have re-examined vanilla Linux kernel, 2.4.24, RedHat's glibc-kernelheaders, Gentoo kernel headers and ALL have a static __inline__.
Would you be so kind and let me know which version of the kernel headers did you take a look at ?
I'm fine with anything as long as it does the job and is legal. And if you want to have and extern __inline__ although Linux has it static, I will have to add several swab functions into generic library.
I'm trying to "fix" this issue because of debugging with -O0. It is much simplier.
Quote from GCC 3.2.2 manual:
If you specify both inline and extern in the function definition, then the definition is used only for inlining. In no case is the function compiled on its own, not even if you refer to its address explicitly. Such an address becomes an external reference, as if you had only declared the function, and had not defined it.
This combination of inline and extern has almost the effect of a macro. The way to use it is to put a function definition in a header file with these keywords, and put another copy of the definition (lacking inline and extern) in a library file. The definition in the header file will cause most calls to the function to be inlined. If any uses of the function remain, they will refer to the single copy in the library.
Since GCC eventually will implement ISO C99 semantics for inline functions, it is best to use static inline only to guarentee compatibility. (The existing semantics will remain available when -std=gnu89 is specified, but eventually the default will be -std=gnu99 and that will implement the C99 semantics, though it does not do so yet.)
End of Quote.
Happy New Year's,

In message 1071237953.30434.196.camel@tt-devel.ultra.si you wrote:
Fixes: o the optimization can now be disabled (config.mk: OPTFLAGS = -O0) (makes debugging easier) Change: o changed extern __inline__ into static __inline__ in include/linux/byteorder/swab.h
Added. Thanks.
Best regards,
Wolfgang Denk
participants (2)
-
Leon Kukovec
-
Wolfgang Denk