History log of /optee_os/mk/cc-option.mk (Results 1 – 5 of 5)
Revision Date Author Comments
# 092db7fb 17-May-2023 Jerome Forissier <jerome.forissier@linaro.org>

build: add -Werror to cc-option check

Clang emits a warning, not an error, and returns a success status when
passed a -Wxxx option that it does not recognize. This makes the
cc-option macro behave i

build: add -Werror to cc-option check

Clang emits a warning, not an error, and returns a success status when
passed a -Wxxx option that it does not recognize. This makes the
cc-option macro behave incorrectly with Clang when testing such options.

$ aarch64-linux-gnu-gcc -Wdoes-not-exist -c -x c /dev/null
aarch64-linux-gnu-gcc: error: unrecognized command-line option ‘-Wdoes-not-exist’
$ echo $?
1

$ clang --target=aarch64-linux-gnu -Wdoes-not-exist -c -x c /dev/null
warning: unknown warning option '-Wdoes-not-exist'; did you mean '-Wmicrosoft-exists'? [-Wunknown-warning-option]
1 warning generated.
$ echo $?
0

Fix that by adding -Werror to the test command.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


# 79f882fc 20-Nov-2020 Jerome Forissier <jerome@forissier.org>

build: fix ld-option again

Commit 5510db0b9458 ("build: ld-option: handle any linker warning as an
error") fixed an issue when used with the GNU linker, but while doing
so it broke the Clang use cas

build: fix ld-option again

Commit 5510db0b9458 ("build: ld-option: handle any linker warning as an
error") fixed an issue when used with the GNU linker, but while doing
so it broke the Clang use case. The problem is, the exit status tested
by `|| echo "Not supported"' is the one from grep, not the one from the
link command.

The fix provided here is tested with GCC (ld) and Clang (ld.lld).

Fixes: 5510db0b9458 ("build: ld-option: handle any linker warning as an error")
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


# 5510db0b 13-Oct-2020 Jerome Forissier <jerome@forissier.org>

build: ld-option: handle any linker warning as an error

The purpose of the ld-option macro is to detect if the linker supports
a given command line option or not. It does so by invoking the linker
w

build: ld-option: handle any linker warning as an error

The purpose of the ld-option macro is to detect if the linker supports
a given command line option or not. It does so by invoking the linker
with the option and checking the exit status of the process. Some
options however may not cause an error but only generate a warning
message, and the linker exits with a success status. For example,
'-z unrecognized-option' does cause an error with Clang but triggers a
warning with GCC. As a result, $(call ld-option,-z unrecognized-option)
has a different behavior depending on the compiler.

Address this issue by loooking for the word 'warning' in the linker
output in addition to checking the exit status.

Fixes the following warning when building xtest shared libraries with
GCC:

path/to/bin/arm-linux-gnueabihf-ld.bfd: warning: -z separate-loadable-segments ignored

Signed-off-by: Jerome Forissier <jerome@forissier.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


# 32f25468 28-May-2020 Jerome Forissier <jerome@forissier.org>

build: introduce ld-option macro

Adds a makefile macro to test if the linker supports a given option.

Signed-off-by: Jerome Forissier <jerome@forissier.org>
Acked-by: Jens Wiklander <jens.wiklander

build: introduce ld-option macro

Adds a makefile macro to test if the linker supports a given option.

Signed-off-by: Jerome Forissier <jerome@forissier.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


# 331ebf7e 26-May-2020 Jerome Forissier <jerome@forissier.org>

Allow use of cc-option in core/arch/arm/arm.mk

It can be useful to call the cc-option macro when setting flags in
core/arch/arm/arm.mk. Unfortunately cc-option is defined in
mk/compile.mk which is t

Allow use of cc-option in core/arch/arm/arm.mk

It can be useful to call the cc-option macro when setting flags in
core/arch/arm/arm.mk. Unfortunately cc-option is defined in
mk/compile.mk which is too late to be useful (core/arch/arm/arm.mk is
included by core/core.mk before mk/compile.mk).

This commit addresses the issue by moving the definition of cc-option
to its own file, mk/cc-option.mk, which is then included by
core/arch/arm/arm.mk. There is a dependency on the compiler definitions
(mk/gcc.mk or mk/clang.mk) and on $(arch-bit-$(sm)) so
core/arch/arm/arm.mk is modified accordingly.

Moving cc-option out of mk/compile.mk means that all non-core
submodules would lose the definition unless they include
mk/cc-option.mk; the TA dev kit is modified so that TAs can call
cc-option from within their sub.mk files. As for other submodules, they
are internal and do not use cc-options as of now so they are not
modified.

Signed-off-by: Jerome Forissier <jerome@forissier.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...