Warning: unknown platform, assuming -mfloat-abi=soft

i am running cling on CA9,
uname -m
armv7l

    readelf -a cling
      Flags:                             0x5000400, Version5 EABI, hard-float ABI

so it should be hard-float, why it is showing soft(without FPU)?

it shows below warning:
warning: unknown platform, assuming -mfloat-abi=soft


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


ldd cling
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6f28000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6f15000)
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6e02000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6d81000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6d58000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6c60000)
/lib/ld-linux-armhf.so.3 (0x7f606000)

it’s indeed armhf, so why “warning: unknown platform, assuming -mfloat-abi=soft”

Xinghao Chen

even i called cling with -mfloat-abi=hard, the warning is disappeared,
however, when i looked into “.I”
-extern-c-isystem
/include
-extern-c-isystem
/usr/include

still missed “/usr/include/arm-linux-gnueabihf”, which will result in some system header lookup failure.
how can i fix it?

Thanks
Xinghao Chen

though explicitly to have “-I /usr/include/arm-linux-gnueabihf” can fix it,
i don’t like such a brutal WA.

Hi,

maybe @oshadura or @Axel can help here.

Two questions:

  1. “warning: unknown platform, assuming -mfloat-abi=soft” is showing when and where exactly? Can you paste the surrounding output?

  2. Can you install clang-5? What does this output: echo | clang-5 --verbose -fsyntax-only -x c++ -

Axel.

it’s right after i ran cling

ericxh@armv7l:~/work/git_work/interpreter/inst_armv7l/bin$ ./clang-5.0 --verbose -fsyntax-only -x c++ -
clang version 5.0.0 (http://root.cern.ch/git/clang.git c698bd59e299f9418c416a08f8ec3bf4c24a314b) (http://root.cern.ch/git/llvm.git e0b472e46eb5861570497c2b9efabf96f2d4a485)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/ericxh/work/git_work/interpreter/inst_armv7l/bin/.
“/mnt/usb/work/git_work/interpreter/inst_armv7hl/bin/clang-5.0” -cc1 -triple aarch64-unknown-linux-gnu -fsyntax-only -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu generic -target-feature +neon -target-abi aapcs -v -dwarf-column-info -debugger-tuning=gdb -resource-dir /mnt/usb/work/git_work/interpreter/inst_armv7hl/lib/clang/5.0.0 -internal-isystem /usr/local/include -internal-isystem /mnt/usb/work/git_work/interpreter/inst_armv7hl/lib/clang/5.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /home/ericxh/work/git_work/interpreter/inst_armv7l/bin -ferror-limit 19 -fmessage-length 130 -fallow-half-arguments-and-returns -fno-signed-char -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -x c++ -
clang -cc1 version 5.0.0 based upon LLVM 5.0.0git-e0b472e46eb default target aarch64-unknown-linux-gnu
ignoring nonexistent directory “/include”
#include “…” search starts here:
#include <…> search starts here:
/usr/local/include
/mnt/usb/work/git_work/interpreter/inst_armv7hl/lib/clang/5.0.0/include
/usr/include
End of search list.

btw, i built cling/clang over a A72 on top of 32bits armhf rootfs, is it relevant?

Thanks
Xinghao Chen

I don’t see any -mfloat-abi= in clang’s output, so it’s using the default. Can you come up with a way to see whether clang-5 is using hard or soft FPU? I also don’t see an entry in the include search path.

i built cling/clang over a A72 on top of 32bits armhf rootfs, is it relevant?

cling (conceptually) gets the clang flags from the compilation CPP macros (see lib/Interpreter/CIFactory.cpp), so this should be okay as long as cling was compiled correctly.

Axel.

We’ll also need to figure out whether cling agrees that this:

should be the target info. I wouldn’t know how to do that but with a debugger; maybe you have an alternative idea?

Axel.

readelf -a clang-5.0

ELF Header:
Magic: 7f 45 4c 46 01 01 01 03 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2’s complement, little endian
Version: 1 (current)
OS/ABI: UNIX - GNU
ABI Version: 0
Type: EXEC (Executable file)
Machine: ARM
Version: 0x1
Entry point address: 0x4163f5
Start of program headers: 52 (bytes into file)
Start of section headers: 68129148 (bytes into file)
Flags: 0x5000400, Version5 EABI, hard-float ABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 10
Size of section headers: 40 (bytes)
Number of section headers: 31
Section header string table index: 30

" -internal-externc-isystem /include -internal-externc-isystem /usr/include", missing the “/usr/include/arm-linux-gnueabihf”,
so how clang get his? by cmake configuration?

btw, i found under obj,
./tools/cling/lib/Interpreter/cling-compiledata.h.in: #define CLING_CXX_INCL “/usr/include/c++/7:/usr/include/arm-linux-gnueabihf/c++/7:/usr/include/c++/7/backward”
./tools/cling/lib/Interpreter/cling-compiledata.h: #define CLING_CXX_INCL “/usr/include/c++/7:/usr/include/arm-linux-gnueabihf/c++/7:/usr/include/c++/7/backward”

so why clang/cling don’t have /usr/include/arm-linux-gnueabihf/ for -extern-c-isystem ?

clang gets the include path likely at runtime - but I would have expected to see it in the -v output. What does cling show when you enter .I (capital i) at the prompt?

it was in my post ticket, missing /usr/include/arm-linux-gnueabihf
-extern-c-isystem
/include
-extern-c-isystem
/usr/include

How does Failed to build cling via cross compiler relate to this?

no, this is another ticket that i tried to build cling with cross compiler.

in this ticket the cling is built in a native box - A72 over armhf rootfs.

anyway i am trying to re-build the cling but add -DCMAKE_CXX_FLAGS=’-march=armv7-a -mfloat-abi=hard’,

i will update the result.
thanks
Xinghao Chen

still not working after i rebuilt with -DCMAKE_CXX_FLAGS=’-march=armv7-a -mfloat-abi=hard’

so i decided to take the dirty way as above to add -mfloat-abi=hard -I/usr/include/arm-linux-gnueabihf

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.