Skip to content
Commit 89e40e73 authored by Jagadeesh Krishnanjanappa's avatar Jagadeesh Krishnanjanappa Committed by Martin Jansa
Browse files

libuio: fix build issue with gcc-5



1. Remove  PNBLACKLIST[libuio] line, since libuio compiles fine with gcc-5
   with this patch.

2. By default, gcc-5 uses C99 inline semantics, this semantics doesn't
generate externally visible function for inline functions. This results in
below error, when an another translation unit (TU) tries to link with the
inline function,

-- snip --
| lsuio.o: In function `main':
| <...>/libuio/0.2.1-r0/git/tools/lsuio.c:85: undefined reference to `uio_mmap'
| collect2: error: ld returned 1 exit status
| make[2]: *** [lsuio] Error 1
-- CUT --

To solve this error and make libuio to compile with both 4.x and 5.x,

1. We can remove 'uio_mmap' inline function definition in uio_mmap.c, and move
   that definition into uio_helper.h file (which is included by lsuio.c) and
   replace inline with "static inline". Similarly it can be done to
   uio_single_munmap and uio_munmap inline functions

2. Add 'extern' keyword in front of uio_mmap inline function declaration , to
   make uio_mmap as a externally visible function, and so that it can be
   linked with other TUs.

Going with option 1.

Signed-off-by: default avatarJagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
Signed-off-by: default avatarMartin Jansa <Martin.Jansa@gmail.com>
parent 4272ccb8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment