Skip to contentSkip to conversation

compile fails for libcpuset.c on SLES-11 s390x with ltp-full-20090930

PATCH Subrata Modak 2 participants 7 messages Oct 14, 2009 – Oct 15, 2009 5 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi Mark,

Quoted 50 lines · Garrett Cooper
Quoted 34 lines · Mark Ver

Trying to build ltp-full-20090930 on SLES-11. The "make all" gets the following:

...
make[5]: Entering directory `/root/ltp-full-20090930/testcases/kernel/controllers/cpuset/cpuset_lib' gcc -g -O2 -Wall -g -Wextra -I../../../../include -c -o cpuinfo.o cpuinfo.c gcc -g -O2 -Wall -g -Wextra -I../../../../include -c -o libbitmask.o libbitmask.c
gcc -g -O2 -Wall -g -Wextra -I../../../../include -c -o libcpuset.o libcpuset.c
libcpuset.c: In function ���get_mempolicy���:
libcpuset.c:3092: error: ���__NR_get_mempolicy��� undeclared (first use in this function)
libcpuset.c:3092: error: (Each undeclared identifier is reported only once libcpuset.c:3092: error: for each function it appears in.) libcpuset.c: In function ���set_mempolicy���:
libcpuset.c:3097: error: ���__NR_set_mempolicy��� undeclared (first use in this function)
make[5]: *** [libcpuset.o] Error 1
make[5]: Leaving directory `/root/ltp-full-20090930/testcases/kernel/controllers/cpuset/cpuset_lib' make[4]: *** [all] Error 2
make[4]: Leaving directory `/root/ltp-full-20090930/testcases/kernel/controllers/cpuset' make[3]: *** [all] Error 2
make[3]: Leaving directory `/root/ltp-full-20090930/testcases/kernel/controllers'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/ltp-full-20090930/testcases/kernel' make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/ltp-full-20090930/testcases'
make: *** [all] Error 2

Quoted 5 lines

As far as I can tell the architecture does not support get_mempolicy and set_mem_policy.

Here are the configure logs and stuff from the build attempt:
(See attached file: ltp-full-20090930-s390x-builderr.tar.gz)

The constant is defined for the platform, but not with the correct name:

/usr/src/linux/arch/s390/kernel/syscalls.S:NI_SYSCALL

                                 /* 269 sys_get_mempolicy */

/usr/src/linux/arch/s390/include/asm/unistd.h:/* Number 269 is reserved for new sys_get_mempolicy */ /usr/src/linux/arch/s390/include/asm/unistd.h:#define __IGNORE_get_mempolicy

Quoted 6 lines

This needs to be added to testcases/kernel/include/generate.sh for linux_syscall_numbers.h, or an arch specific #ifdef should be added for that test / to an autoconf test that would automatically determine whether or not your platform had a usable get_mempolicy syscall.

Hope that helps describe what needs to take place next...

As Garret proposed, can you please apply the following Patch and see if it solves your build problem. I get the following instructions from 2.6.31 kernel sources:

linux-2.6.31/arch/s390/include/asm/unistd.h:
208 #define __NR_remap_file_pages 267
209 /* Number 268 is reserved for new sys_mbind */ 210 /* Number 269 is reserved for new sys_get_mempolicy */ 211 /* Number 270 is reserved for new sys_set_mempolicy */
212 #define __NR_mq_open 271

---

testcases/kernel/include/s390x.in renamed from testcases/kernel/include/s390x.in.orig +3 -0
@@ -14,3 +14,6 @@ fchmodat (__NR_openat + 11)
 faccessat (__NR_openat + 12)
 eventfd 318
 fallocate 314
+get_mempolicy 269
+set_mempolicy 270
+

---
Regards--
Subrata

-Garrett

Quoted 2 lines

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw

Hi!

testcases/kernel/include/s390x.in fchmodat (__NR_openat + 11) · line 18

Quoted 8 lines
testcases/kernel/include/s390x.in renamed from testcases/kernel/include/s390x.in.orig +2 -0
@@ -14,3 +14,6 @@ fchmodat (__NR_openat + 11)
 faccessat (__NR_openat + 12)
 eventfd 318
 fallocate 314
+get_mempolicy 269
+set_mempolicy 270

This should fix it. Anyway, I have some more architectures that are broken on sles9. Will send patch soon.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#2 lore raw

Hi!
Following patch should fix all troubles with get/set_mempolicy. Header linux_syscall_numbers.h wasn't included in libcpuset.c and part of makefile that creates symlink in $(LTP_TOPDIR)/include to this header was lost in buildsystem rework. May be it would be be cleaner to move content of testcases/kernel/include somewhere into include but at least with this patch it should compile fine.

Signed-off-by [email protected]
Signature · 2 lines
Cyril Hrubis
[email protected]
testcases/kernel/include/powerpc.in +2 -0
Index: delme/testcases/kernel/include/powerpc.in
===================================================================
@@ -3,6 +3,8 @@ timer_settime 241
 timer_delete 244
 clock_settime 245
 clock_gettime 246
+get_mempolicy 260
+set_mempolicy 261
 splice 283
 tee 284
 vmsplice 285
testcases/kernel/include/powerpc64.in +2 -0
Index: delme/testcases/kernel/include/powerpc64.in
===================================================================
@@ -3,6 +3,8 @@ timer_settime 241
 timer_delete 244
 clock_settime 245
 clock_gettime 246
+get_mempolicy 260
+set_mempolicy 261
 splice 283
 tee 284
 vmsplice 285
testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c +3 -0
Index: delme/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c
===================================================================
@@ -48,6 +48,9 @@
 #include "cpuset.h"
 #include "common.h"
 
+#include "test.h"
+#include "linux_syscall_numbers.h"
+
 /* Bump version, and update Change History, when libcpuset API changes */
 #define CPUSET_VERSION 3
 
testcases/kernel/include/Makefile +3 -0
Index: delme/testcases/kernel/include/Makefile
===================================================================
@@ -18,6 +18,7 @@
 #    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 # Garrett Cooper, July 2009
+# Cyril Hrubis, October 2009
 #
 
 top_srcdir		?= ../../..
@@ -30,5 +31,7 @@ MAKE_TARGETS		:= linux_syscall_numbers.h
 
 linux_syscall_numbers.h:
 	@set -e; $(SHELL) $(abs_srcdir)/regen.sh
+	rm -f $(top_srcdir)/include/$(MAKE_TARGETS)
+	ln -s $(abs_srcdir)/$(MAKE_TARGETS) $(top_srcdir)/include/
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/include/s390x.in +2 -0
Index: delme/testcases/kernel/include/s390x.in
===================================================================
@@ -1,3 +1,5 @@
+get_mempolicy 269
+set_mempolicy 270
 openat 288
 mkdirat (__NR_openat + 1)
 mknodat (__NR_openat + 2)

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Hi!

Quoted 7 lines

This logic is covered in include/mk/testcases.mk as follows:

include $(top_srcdir)/include/mk/env_pre.mk

# For linux_syscall_numbers.h
CPPFLAGS += -I$(abs_top_builddir)/testcases/kernel/include

Quoted 8 lines

INSTALL_DIR := testcases/bin

LDLIBS += -lltp

There's no reason why we have to go back to the hackish Makefile's
-- we can just include testcases.mk if it's not included already (I admit, a smallhandful of testcases/... Makefile's didn't do this, but I did this on need-to-have basis).

I still would rather have one place to store all commonly used headers eg. $(topdir)/include. And stroring makefile "libraries" in $(topdir)/include/mk/ is IMHO not cleanest solution, may be it sould have it's onw directory in $(topdir).

Anyway fixed patch attached.

Signed-off-by [email protected]
Signature · 2 lines
Cyril Hrubis
[email protected]
testcases/kernel/include/powerpc.in +2 -0
Index: delme/testcases/kernel/include/powerpc.in
===================================================================
@@ -3,6 +3,8 @@ timer_settime 241
 timer_delete 244
 clock_settime 245
 clock_gettime 246
+get_mempolicy 260
+set_mempolicy 261
 splice 283
 tee 284
 vmsplice 285
testcases/kernel/include/powerpc64.in +2 -0
Index: delme/testcases/kernel/include/powerpc64.in
===================================================================
@@ -3,6 +3,8 @@ timer_settime 241
 timer_delete 244
 clock_settime 245
 clock_gettime 246
+get_mempolicy 260
+set_mempolicy 261
 splice 283
 tee 284
 vmsplice 285
testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c +3 -0
Index: delme/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c
===================================================================
@@ -48,6 +48,9 @@
 #include "cpuset.h"
 #include "common.h"
 
+#include "test.h"
+#include "linux_syscall_numbers.h"
+
 /* Bump version, and update Change History, when libcpuset API changes */
 #define CPUSET_VERSION 3
 
testcases/kernel/include/s390x.in +2 -0
Index: delme/testcases/kernel/include/s390x.in
===================================================================
@@ -1,3 +1,5 @@
+get_mempolicy 269
+set_mempolicy 270
 openat 288
 mkdirat (__NR_openat + 1)
 mknodat (__NR_openat + 2)
testcases/kernel/controllers/cpuset/cpuset_lib/Makefile +2 -1
Index: delme/testcases/kernel/controllers/cpuset/cpuset_lib/Makefile
===================================================================
@@ -18,11 +18,12 @@
 #    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 # Garrett Cooper, July 2009
+# Cyril Hrubis, October 2009
 #
 
 top_srcdir 		?= ../../../../..
 
-include $(top_srcdir)/include/mk/env_pre.mk
+include $(top_srcdir)/include/mk/testcases.mk
 
 LDLIBS			+= -lm -lcontrollers
 

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

Hi!
Hmm, may be we should really move testcases/kernel/include into $(topdir)/include or better move them them to subdir in $(topdir)/include and put the generated header into $(topdir)/include, it would save us some more complexity when creating makefiles.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw

Hi!

Quoted 3 lines

This can be corrected by adding this logic to a common Makefile if
you like, so that way it does get picked up from one common source. This makes more sense from a design perspective.

Okay, this way people wouldn't be using ugly hacks to include that header. IMHO the easier to use is the buildsystem, the less ugly hacks will come.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

#11 lore raw

Hi!

Quoted 13 lines
Quoted 5 lines
Quoted 4 lines

Hmm, may be we should really move testcases/kernel/include into $(topdir)/include or better move them them to subdir in $(topdir)/include and put the generated header into $(topdir)/include, it would save us some more complexity when creating makefiles.

Quoted 7 lines

Cyril,
   Files generated at build time should _never_ live in the source directory. Otherwise tidiness becomes a serious issue, esp with source control.
   This can be corrected by adding this logic to a common Makefile if you like, so that way it does get picked up from one common source. This makes more sense from a design perspective.

Quoted 4 lines

Ugh, I'm tired... yes, what you proposed above was correct, but
not complete from a submake perspective, but then again making Makefiles aren't correct. I will implement the complete part this weekend.

Okay ;)

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list