[RPL/2] 4.1.17 compilation failed on linux

Joël BERTRAND joel.bertrand at systella.fr
Wed May 14 15:27:45 CEST 2014


Le 14/05/2014 15:16, Laurent Laborde a écrit :
> Config.log attached
>
> I think that's what you want to see :
> configure:6234: checking for POSIX semaphores and shared objects
> configure:6258: gcc -o conftest -g -O2  -O3  -lrt -lpthread conftest.c  >&5
> /tmp/cc6wzv2U.o: In function `main':
> /home/ker2x/rpl-4.1.17/conftest.c:19: undefined reference to `shm_open'
> /home/ker2x/rpl-4.1.17/conftest.c:21: undefined reference to `shm_unlink'
> /home/ker2x/rpl-4.1.17/conftest.c:22: undefined reference to `sem_open'
> /home/ker2x/rpl-4.1.17/conftest.c:24: undefined reference to `sem_unlink'
> collect2: ld returned 1 exit status
> configure:6258: $? = 1
> configure: failed program was:
> | /* confdefs.h */
> | #define PACKAGE_NAME "rpl"
> | #define PACKAGE_TARNAME "rpl"
> | #define PACKAGE_VERSION "4.1.17"
> | #define PACKAGE_STRING "rpl 4.1.17"
> | #define PACKAGE_BUGREPORT ""
> | #define PACKAGE_URL ""
> | #define PACKAGE "rpl"
> | #define VERSION "4.1.17"
> | /* end confdefs.h.  */
> | #include <sys/mman.h>
> | #include <sys/stat.h>
> | #include <fcntl.h>
> |
> | int
> | main ()
> | {
> |  int fd; char *sem = "/test";
> | fd = shm_open(sem , O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
> |   close(fd);
> |   shm_unlink(sem);
> |   fd = sem_open(sem, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, 0);
> |   close(fd);
> |   sem_unlink(sem);
> |   return(0);
> |
> |   ;
> |   return 0;
> | }

	It seems to be an obvious gcc bug (but I haven't never seen it even 
when I used gcc 4.6). Old gcc versions try to link libraries in order. 
You can try to swap -lrt and -lpthread (configure.ac:1426) or you can 
use a recent gcc (4.8, not 4.7).

	JKB



More information about the RPL2 mailing list