Daniel Bristot de Oliveira
828be9ff17
tools/rv: Fix Makefile compiler options for clang
...
commit f9b2c87105c989a7b259c6da87673ada96dce2f8 upstream.
The following errors are showing up when compiling rv with clang:
$ make HOSTCC=clang CC=clang LLVM_IAS=1
[...]
clang -O -g -DVERSION=\"6.8.0-rc1\" -flto=auto -ffat-lto-objects
-fexceptions -fstack-protector-strong -fasynchronous-unwind-tables
-fstack-clash-protection -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
-Wno-maybe-uninitialized $(pkg-config --cflags libtracefs)
-I include -c -o src/utils.o src/utils.c
clang: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
1 warning generated.
clang -o rv -ggdb src/in_kernel.o src/rv.o src/trace.o src/utils.o $(pkg-config --libs libtracefs)
src/in_kernel.o: file not recognized: file format not recognized
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:110: rv] Error 1
Solve these issues by:
- removing -ffat-lto-objects and -Wno-maybe-uninitialized if using clang
- informing the linker about -flto=auto
Link: https://lkml.kernel.org/r/ed94a8ddc2ca8c8ef663cfb7ae9dd196c4a66b33.1707217097.git.bristot@kernel.org
Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Bill Wendling <morbo@google.com>
Cc: Justin Stitt <justinstitt@google.com>
Fixes: 4bc4b131d44c ("rv: Add rv tool")
Suggested-by: Donald Zickus <dzickus@redhat.com>
Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-23 09:25:14 +01:00
..
2024-02-23 09:24:47 +01:00
2024-01-10 17:16:54 +01:00
2024-02-05 20:14:31 +00:00
2023-08-08 15:43:03 -06:00
2023-07-24 10:29:52 -04:00
2023-11-20 11:59:18 +01:00
2023-12-03 07:33:02 +01:00
2023-11-20 11:59:26 +01:00
2024-02-23 09:24:47 +01:00
2024-02-05 20:14:32 +00:00
2023-09-05 10:13:45 -07:00
2023-10-13 17:27:27 -07:00
2023-12-20 17:01:51 +01:00
2024-02-16 19:10:42 +01:00
2023-12-03 07:33:04 +01:00
2023-08-03 16:59:40 -03:00
2024-02-23 09:25:00 +01:00
2023-11-20 11:59:29 +01:00
2024-02-23 09:25:14 +01:00
2023-10-16 05:32:23 -04:00
2023-08-07 15:57:25 -10:00