Skip to contentSkip to conversation

"check_for_unshare.c" build failed

LTP Mitani 3 participants 4 messages Mar 10, 2010 – Mar 11, 2010

lore
Share & tools
lore

Mitani

author
#0 lore raw

Hi,

I tried to build LTP modules from following git:

"Fix make filed,, reported by Shi Weihua <[email protected]>" (ltp-dev-c962f51674b971496e14ac4be0cc75da98b75fca.tar.gz)

But I failed to build "check_for_unshare.c" in RHEL5.4 system (2.6.18-164.el5).

------------
<...>
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -I../../../include
-I../../../include -L../../../lib check_for_unshare.c -o
check_for_unshare
/tmp/ccWzyOQO.o: In function `main':
/home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/check_for_unsh are.c:40: undefined reference to dlopen' /home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/check_for_unsh are.c:46: undefined reference to dlerror' /home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/check_for_unsh are.c:47: undefined reference to dlsym' /home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/check_for_unsh are.c:48: undefined reference to dlerror' /home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/check_for_unsh are.c:53: undefined reference to dlclose' /home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/check_for_unsh are.c:42: undefined reference to dlerror'
collect2: ld returned 1 exit status
make[3]: *** [check_for_unshare] Error 1
<...>
------------

I think that "-ldl" is needed in options.
I tried to build using "-ldl" option and succeeded.

------------
[root@RHEL54-INTEL64-GUIDE-APDB2-AP containers]# gcc -g -O2 -g -O2 -ldl -fno-strict-aliasi
ng -pipe -Wall -I../../../include -I../../../include -L../../../lib
check_for_unshare.
c -o check_for_unshare
[root@RHEL54-INTEL64-GUIDE-APDB2-AP containers]# echo $?
0
[root@RHEL54-INTEL64-GUIDE-APDB2-AP containers]# ll
total 60

-rw-rw-r-- 1 root root  1396 Mar 10 01:23 Makefile
-rw-rw-r-- 1 root root  1386 Mar 10 01:23 Makefile.inc
-rw-rw-r-- 1 root root  3286 Mar 10 01:23 README
-rw-rw-r-- 1 root root  1451 Mar 10 01:23 TEST_PLAN.txt
-rwxr-xr-x 1 root root 10805 Mar 10 15:18 check_for_unshare
-rw-rw-r-- 1 root root  1634 Mar 10 01:23 check_for_unshare.c
-rwxrwxr-x 1 root root  1712 Mar 10 01:23 container_test.sh
drwxrwxr-x 2 root root  4096 Mar 10 10:42 libclone
drwxrwxr-x 2 root root  4096 Mar 10 01:23 mqns
drwxrwxr-x 2 root root  4096 Mar 10 01:23 netns
drwxrwxr-x 2 root root  4096 Mar 10 01:23 pidns
drwxrwxr-x 2 root root  4096 Mar 10 01:23 sysvipc
drwxrwxr-x 2 root root  4096 Mar 10 01:23 utsname

[root@RHEL54-INTEL64-GUIDE-APDB2-AP containers]#
------------

How about changing Makefile as follows?

============
--- ./testcases/kernel/containers/Makefile 2010-03-10
01:23:25.000000000 +0900
+++ ./testcases/kernel/containers/Makefile.new 2010-03-10 15:27:20.000000000 +0900
@@ -28,6 +28,8 @@

LIB := -ld

+CFLAGS += -ldl
+
INSTALL_TARGETS := *.sh

$(LIBDIR):
============

Regards--

-Tomonori Mitani

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw

Hi Mitani,

I am able to compile with changing LDLIBS as done by commit : 1a5506c97dcfda0bd16f83ca855bb633c47eea4c

on RHEL5.4 .

Can you try configuring once again ?

Let me know when you face again some prob.

-Rishi

Quoted 101 lines · Mitani

Hi,

I tried to build LTP modules from following git:

"Fix make filed,, reported by Shi Weihua <[email protected]>" (ltp-dev-c962f51674b971496e14ac4be0cc75da98b75fca.tar.gz)

But I failed to build "check_for_unshare.c" in RHEL5.4 system (2.6.18-164.el5).

------------
<...>
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -I../../../include
-I../../../include -L../../../lib check_for_unshare.c -o
check_for_unshare
/tmp/ccWzyOQO.o: In function `main':
/home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/check_for_unsh are.c:40: undefined reference to dlopen' /home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/check_for_unsh are.c:46: undefined reference to dlerror' /home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/check_for_unsh are.c:47: undefined reference to dlsym' /home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/check_for_unsh are.c:48: undefined reference to dlerror' /home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/check_for_unsh are.c:53: undefined reference to dlclose' /home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/check_for_unsh are.c:42: undefined reference to dlerror'
collect2: ld returned 1 exit status
make[3]: *** [check_for_unshare] Error 1
<...>
------------

I think that "-ldl" is needed in options.
I tried to build using "-ldl" option and succeeded.

------------
[root@RHEL54-INTEL64-GUIDE-APDB2-AP containers]# gcc -g -O2 -g -O2 -ldl -fno-strict-aliasi
ng -pipe -Wall -I../../../include -I../../../include -L../../../lib
check_for_unshare.
c -o check_for_unshare
[root@RHEL54-INTEL64-GUIDE-APDB2-AP containers]# echo $?
0
[root@RHEL54-INTEL64-GUIDE-APDB2-AP containers]# ll
total 60

(quoted diff) +0 -7
-rw-rw-r-- 1 root root  1396 Mar 10 01:23 Makefile
-rw-rw-r-- 1 root root  1386 Mar 10 01:23 Makefile.inc
-rw-rw-r-- 1 root root  3286 Mar 10 01:23 README
-rw-rw-r-- 1 root root  1451 Mar 10 01:23 TEST_PLAN.txt
-rwxr-xr-x 1 root root 10805 Mar 10 15:18 check_for_unshare
-rw-rw-r-- 1 root root  1634 Mar 10 01:23 check_for_unshare.c
-rwxrwxr-x 1 root root  1712 Mar 10 01:23 container_test.sh
drwxrwxr-x 2 root root  4096 Mar 10 10:42 libclone
drwxrwxr-x 2 root root  4096 Mar 10 01:23 mqns
drwxrwxr-x 2 root root  4096 Mar 10 01:23 netns
drwxrwxr-x 2 root root  4096 Mar 10 01:23 pidns
drwxrwxr-x 2 root root  4096 Mar 10 01:23 sysvipc
drwxrwxr-x 2 root root  4096 Mar 10 01:23 utsname

[root@RHEL54-INTEL64-GUIDE-APDB2-AP containers]#
------------

How about changing Makefile as follows?

============
--- ./testcases/kernel/containers/Makefile 2010-03-10
01:23:25.000000000 +0900
+++ ./testcases/kernel/containers/Makefile.new 2010-03-10 15:27:20.000000000 +0900

(quoted diff) +2 -0
@@ -28,6 +28,8 @@
 
 LIB                    := -ld
 
+CFLAGS                  += -ldl
+
 INSTALL_TARGETS                := *.sh
 
 $(LIBDIR):

============

Regards--

-Tomonori Mitani

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Signature · 16 lines
Thanks & Regards
Rishi
LTP Maintainer
IBM, LTC, Bangalore
Please join IRC #ltp @ irc.freenode.net

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
author
#2 lore raw

Hi, Rishikesh

I tried to build again with recent git today and I could build.

I neglected attention and did not notice new git.

I'm sorry and thank you for your information!

-Tomonori Mitani

Quoted 140 lines

-----Original Message-----
From: Rishikesh K Rajak [mailto:[email protected]]
Sent: Wednesday, March 10, 2010 7:49 PM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] "check_for_unshare.c" build failed

Hi Mitani,

I am able to compile with changing LDLIBS as done by commit : 1a5506c97dcfda0bd16f83ca855bb633c47eea4c

on RHEL5.4 .

Can you try configuring once again ?

Let me know when you face again some prob.

-Rishi

Quoted 8 lines · Mitani

Hi,

I tried to build LTP modules from following git:

"Fix make filed,, reported by Shi Weihua <[email protected]>" (ltp-dev-c962f51674b971496e14ac4be0cc75da98b75fca.tar.gz)

Quoted 6 lines

But I failed to build "check_for_unshare.c" in RHEL5.4 system (2.6.18-164.el5).

------------
<...>
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall

-I../../../include

Quoted 4 lines

-I../../../include -L../../../lib check_for_unshare.c -o
check_for_unshare
/tmp/ccWzyOQO.o: In function `main':

/home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/chec k_for_unsh

Quoted 2 lines

are.c:40: undefined reference to `dlopen'

/home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/chec k_for_unsh

Quoted 2 lines

are.c:46: undefined reference to `dlerror'

/home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/chec k_for_unsh

Quoted 2 lines

are.c:47: undefined reference to `dlsym'

/home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/chec k_for_unsh

Quoted 2 lines

are.c:48: undefined reference to `dlerror'

/home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/chec k_for_unsh

Quoted 2 lines

are.c:53: undefined reference to `dlclose'

/home/mitani/LTP/ltp-dev-20100310/testcases/kernel/containers/chec k_for_unsh

Quoted 7 lines

are.c:42: undefined reference to `dlerror'
collect2: ld returned 1 exit status
make[3]: *** [check_for_unshare] Error 1
<...>
------------

Quoted 5 lines

I think that "-ldl" is needed in options.
I tried to build using "-ldl" option and succeeded.

------------
[root@RHEL54-INTEL64-GUIDE-APDB2-AP containers]# gcc -g -O2 -g -O2

-ldl

Quoted 2 lines

-fno-strict-aliasi
ng -pipe -Wall -I../../../include -I../../../include

-L../../../lib

Quoted 42 lines

check_for_unshare.
c -o check_for_unshare
[root@RHEL54-INTEL64-GUIDE-APDB2-AP containers]# echo $? 0
[root@RHEL54-INTEL64-GUIDE-APDB2-AP containers]# ll total 60

(quoted diff) +0 -7
-rw-rw-r-- 1 root root  1396 Mar 10 01:23 Makefile
-rw-rw-r-- 1 root root  1386 Mar 10 01:23 Makefile.inc
-rw-rw-r-- 1 root root  3286 Mar 10 01:23 README
-rw-rw-r-- 1 root root  1451 Mar 10 01:23 TEST_PLAN.txt
-rwxr-xr-x 1 root root 10805 Mar 10 15:18 check_for_unshare
-rw-rw-r-- 1 root root  1634 Mar 10 01:23 check_for_unshare.c
-rwxrwxr-x 1 root root  1712 Mar 10 01:23 container_test.sh
drwxrwxr-x 2 root root  4096 Mar 10 10:42 libclone
drwxrwxr-x 2 root root  4096 Mar 10 01:23 mqns
drwxrwxr-x 2 root root  4096 Mar 10 01:23 netns
drwxrwxr-x 2 root root  4096 Mar 10 01:23 pidns
drwxrwxr-x 2 root root  4096 Mar 10 01:23 sysvipc
drwxrwxr-x 2 root root  4096 Mar 10 01:23 utsname

[root@RHEL54-INTEL64-GUIDE-APDB2-AP containers]#
------------

How about changing Makefile as follows?

============
--- ./testcases/kernel/containers/Makefile 2010-03-10
01:23:25.000000000 +0900
+++ ./testcases/kernel/containers/Makefile.new 2010-03-10 15:27:20.000000000 +0900

(quoted diff) +2 -0
@@ -28,6 +28,8 @@
 
 LIB                    := -ld
 
+CFLAGS                  += -ldl
+
 INSTALL_TARGETS                := *.sh
 
 $(LIBDIR):

============

Quoted 8 lines

Regards--

-Tomonori Mitani

------------------------------------------------------------------
------------

Quoted 9 lines

Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Quoted 6 lines

--
Thanks & Regards
Rishi
LTP Maintainer
IBM, LTC, Bangalore
Please join IRC #ltp @ irc.freenode.net

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw
In reply to Mitani
Quoted 5 lines · Mitani

Hi,

I tried to build LTP modules from following git:

...

Quoted 13 lines

How about changing Makefile as follows?

============
--- ./testcases/kernel/containers/Makefile      2010-03-10 01:23:25.000000000 +0900
+++ ./testcases/kernel/containers/Makefile.new  2010-03-10 15:27:20.000000000 +0900

(quoted diff) +0 -0
@@ -28,6 +28,8 @@
 

 LIB                    := -ld

(quoted diff) +2 -0
+CFLAGS                  += -ldl
+
Quoted 1 line

 INSTALL_TARGETS                := *.sh

I realize that this has already been resolved, but just to make
sure we're all clear LDLIBS should contain -l arguments, LDFLAGS should contain all non- -l arguments which get passed to ld(1), CPPFLAGS should contain all items which need to get passed to cpp(1) and cc(1), and CFLAGS should contain everything that needs to go strictly to cc(1).
So... -l arguments should _NEVER_ be put in CFLAGS.
Thanks,
-Garrett

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list