make[3]: Entering directory `/data/iamroot/xen/setup/xen-unstable.hg/tools/libxl'

gcc  -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement  -D__XEN_TOOLS__ -MMD -MF .libxl.o.d  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  -Werror -Wno-format-zero-length -Wmissing-declarations  -I. -fPIC -I../../tools/libxc -I../../tools/include -I../../tools/libxc -I../../tools/include -I../../tools/xenstore -I../../tools/include -I../../tools/blktap2/control -I../../tools/blktap2/include -I../../tools/include -c -o libxl.o libxl.c

cc1: warnings being treated as errors

libxl.c: In function ‘libxl_create_cpupool’:

libxl.c:3981: error: format not a string literal and no format arguments

libxl.c:3983: error: format not a string literal and no format arguments

libxl.c: In function ‘libxl_cpupool_movedomain’:

libxl.c:4095: error: format not a string literal and no format arguments

make[3]: *** [libxl.o] 오류 1

make[3]: Leaving directory `/data/iamroot/xen/setup/xen-unstable.hg/tools/libxl'

make[2]: *** [subdir-install-libxl] 오류 2

make[2]: Leaving directory `/data/iamroot/xen/setup/xen-unstable.hg/tools'

make[1]: *** [subdirs-install] 오류 2

make[1]: Leaving directory `/data/iamroot/xen/setup/xen-unstable.hg/tools'

make: *** [install-tools] 오류 2



위와 같이 libxl에서 에러가 발생하는 이유는 gcc 4.3이상 부터 가변인자로 형식으로 argument를 받을 때 char *변수를 통해 입력을 할 경우 이를 warning이 발생 되도록 바뀌었음.

xen에서는 빌드 시 옵션을 -Werror를 주므로 warning도 에러로 처리 해서 문제가 됨.

위의 빌드에러를 고치기 위해 소스를 수정 해야 한다.

<수정 전>
3980         libxl__xs_write(&gc, t, libxl__sprintf(&gc, "/local/pool/%d/uuid", *poolid),
3981                  uuid_string);
3982         libxl__xs_write(&gc, t, libxl__sprintf(&gc, "/local/pool/%d/name", *poolid),
3983                  name);


<수정 후>

3980         libxl__xs_write(&gc, t, libxl__sprintf(&gc, "/local/pool/%d/uuid", *poolid), "%s",
3981                  uuid_string);
3982         libxl__xs_write(&gc, t, libxl__sprintf(&gc, "/local/pool/%d/name", *poolid), "%s",
3983                  name);


<수정 전>

4095         libxl__xs_write(&gc, t, libxl__sprintf(&gc, "%s/pool_name", vm_path), poolname);


<수정 후>

4095         libxl__xs_write(&gc, t, libxl__sprintf(&gc, "%s/pool_name", vm_path), "%s", poolname);



위와 같이 수정 하시면 빌드 시 에러가 발생 안합니다.

XE Login