#make defconfig
然後再用某toolchain,
#make ARCH=arm CROSS_COMPILE=arm-linux-
編譯之後會產生兩個狀況的error,此為其一,另一個為route,
但我尚未找到解決方法,暫時將其disable就可以編譯過,
而這個taskset.c我在網路上找到如下一篇文章,
主要的問題是產生在sched_getaffinity與sched_setaffinity
這兩個函式的參數個數,
busybox主要為uclibc所設計,而在glibc底下剛好就發生了這個mismatch,
而編譯的狀況跟source code修改如下,如此即可順利編譯成功!
---------------------------------------------------------------------------------------------------------
CC miscutils/taskset.o
miscutils/taskset.c: In function `taskset_main':
miscutils/taskset.c:78: warning: passing arg 2 of `sched_getaffinity'
makes pointer from integer without a cast
miscutils/taskset.c:78: error: too many arguments to function
`sched_getaffinity'
miscutils/taskset.c:86: warning: passing arg 2 of `sched_setaffinity'
makes pointer from integer without a cast
miscutils/taskset.c:86: error: too many arguments to function
`sched_setaffinity'
make[1]: *** [miscutils/taskset.o] Error 1
make: *** [miscutils] Error 2
Something like this should work, unless there is a more elegant way:
--- bk.taskset.c 2007-06-30 11:06:44.000000000 -0400
+++ taskset.c 2007-09-12 10:12:29.324150000 -0400
@@ -75,7 +75,13 @@
if (opt & OPT_p) {
print_aff:
+ /* Pb: glibc has 2 params for this func */
+#ifdef __GLIBC__
+#warning "GLIBC DEFINED"
+ if (sched_getaffinity(pid, &mask) < 0)
+#else
if (sched_getaffinity(pid, sizeof(mask), &mask) < 0)
+#endif
bb_perror_msg_and_die("failed to %cet pid %d's
affinity", 'g', pid);
printf("pid %d's %s affinity mask: "TASKSET_PRINTF_MASK"\n",
pid, state, from_cpuset(mask));
@@ -83,7 +89,12 @@
return EXIT_SUCCESS;
}
+ /* Pb: glibc has 2 params for this func */
+#ifdef __GLIBC__
+ if (sched_setaffinity(pid, &new_mask))
+#else
if (sched_setaffinity(pid, sizeof(new_mask), &new_mask))
+#endif
bb_perror_msg_and_die("failed to %cet pid %d's affinity",
's', pid);
if (opt & OPT_p) {
state += 8;
------------------------------------------------------------------------------------------------------------
沒有留言:
張貼留言