Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LTP tries to build open-posix tests with default cc even if custom compiler is provided #54

Closed
mnowaksuse opened this issue Jan 11, 2016 · 1 comment

Comments

@mnowaksuse
Copy link

On master I configure LTP to be build with GCC5:

CC=/usr/bin/gcc-5 ./configure --with-open-posix-testsuite
make -j$(getconf _NPROCESSORS_ONLN) all

All but open-posix tests are built with GCC5. The open-posix test are attempted to be build with stock GCC (/usr/bin/gcc I guess) which is not present in my installation (SLES 12SP1 with GCC5 from Toolchain Module):

make[5]: Leaving directory '/root/ToolchainModuleTesting/BUILD/ltp-master/testcases/kernel/include'
/usr/bin/gcc-5 -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -W -Wold-style-definition -D_FORTIFY_SOURCE=2 -I/root/ToolchainModuleTesting/BUILD/ltp-master/testcases/kernel/include -I../../../../include -I../../../../include   -L../../../../lib  delete_module01.c   -lltp -o delete_module01
...
make[4]: Leaving directory '/root/ToolchainModuleTesting/BUILD/ltp-master/testcases/kernel/module/delete_module'
...
Generating buildonly Makefiles
Generating runnable Makefiles
conformance/interfaces/pthread_create/15-1.c should be test.
Generating test-tools Makefiles
make[3]: Leaving directory '/root/ToolchainModuleTesting/BUILD/ltp-master/testcases/open_posix_testsuite'
make[3]: Entering directory '/root/ToolchainModuleTesting/BUILD/ltp-master/testcases/open_posix_testsuite/conformance'
make[4]: Entering directory '/root/ToolchainModuleTesting/BUILD/ltp-master/testcases/open_posix_testsuite/conformance/behavior'
make[5]: Entering directory '/root/ToolchainModuleTesting/BUILD/ltp-master/testcases/open_posix_testsuite/conformance/behavior/timers'
/bin/sh: cc: command not found
conformance/behavior/timers/1-1 compile FAILED; SKIPPING
/bin/sh: cc: command not found
conformance/behavior/timers/2-1 compile FAILED; SKIPPING
make[5]: Leaving directory '/root/ToolchainModuleTesting/BUILD/ltp-master/testcases/open_posix_testsuite/conformance/behavior/timers'
...
@metan-ucw
Copy link
Member

The Open Posix Testsuite build system was never integrated with the rest of the LTP. It has separate build system etc. which is mainly because it's intended to be usable on any POSIX-like platform. Looking into the LTP build system all the --with-open-posix-testsuite configure option does is including the open_posix_testsuite directory in the recursive build. Now the CC, CFLAGS, and LDFLAGS are set in the include/mk/config.mk file which is not used by the Open Posix Testsuite build system at all since it's intended to be used separately.

I will try to figure out a way how to propagate the parameters to the Open Posix Testsuite while avoiding unexpected behaviour but I'm not sure that it's doable (since we have to stick with POSIX make there).

You can easily workaround this for now by exporting CC=/usr/bin/gcc-5 before you do the build which should be picked up by both configure and make.

metan-ucw added a commit that referenced this issue May 10, 2016
The open_posix_testsuite can be enabled to build from the top level
configure but none of the parameters passed to it are propagated which
confuses users and has been discussed a few times on the LTP ML.

This commit propagates CC, CFLAGS and LDFLAGS. If config-openposix.mk
was created by the top level configure script the generate-makefiles.sh
script includes its content in the generated Makefiles.

This fixes issue #54.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Jan Stancek <jstancek@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants