[cfe-dev] Clang compiling needs help
Michelle Gu (micgu) via cfe-dev
cfe-dev at lists.llvm.org
Wed Feb 22 00:24:51 PST 2017
Hi Simon,
Thank you for your feedback!
I checkout the live svn repository and build that (http://www.llvm.org/docs/GettingStarted.html).
Then use the option as below to get my object.
ARCH_OPTS=-target mipsel
CFLAGS=-c -fno-pic -mno-abicalls -integrated-as
But when linked to the mips object, the error code was still there.
Seems nothing changed.
gcc.a(_ucmpdi2.o): warning: linking abicalls files with non-abicalls files
mips-elf-ld: /cygdrive/d/RDA/Projects/QW300/soft/env/lib/gcc/mips-elf/4.4.2//lib
gcc.a(_clzsi2.o): warning: linking abicalls files with non-abicalls files
mips-elf-ld: /cygdrive/d/RDA/Projects/QW300/soft/env/lib/gcc/mips-elf/4.4.2//lib
gcc.a(_fixunsdfsi.o): warning: linking abicalls files with non-abicalls files
mips-elf-ld: /cygdrive/d/RDA/Projects/QW300/soft/env/lib/gcc/mips-elf/4.4.2//lib
gcc.a(_pack_df.o): warning: linking abicalls files with non-abicalls files
mips-elf-ld: /cygdrive/d/RDA/Projects/QW300/soft/env/lib/gcc/mips-elf/4.4.2//lib
gcc.a(_unpack_df.o): warning: linking abicalls files with non-abicalls files
mips-elf-ld: /cygdrive/d/RDA/Projects/QW300/soft/env/lib/gcc/mips-elf/4.4.2//lib
gcc.a(_fpcmp_parts_df.o): warning: linking abicalls files with non-abicalls file
s
mips-elf-ld: /cygdrive/d/RDA/Projects/QW300/soft/env/lib/gcc/mips-elf/4.4.2//lib
gcc.a(_ge_df.o): warning: linking abicalls files with non-abicalls files
mips-elf-ld: /cygdrive/d/RDA/Projects/QW300/soft/env/lib/gcc/mips-elf/4.4.2//lib
gcc.a(_df_to_si.o): warning: linking abicalls files with non-abicalls files
make[2]: *** [/cygdrive/d/RDA/Projects/QW300/soft/build/8851m_dbs_rdamodem_qj/_d
efault_/8809/8851m_dbs_rdamodem_qj_debug_bin.elf] Error 1
make[1]: *** [/cygdrive/d/RDA/Projects/QW300/soft/build/8851m_dbs_rdamodem_qj/_d
efault_/8809/8851m_dbs_rdamodem_qj_debug_bin.srec] Error 2
make: *** [lod] Error 2
Any other suggestion.
BR,
Michelle
-----Original Message-----
From: Simon Dardis [mailto:Simon.Dardis at imgtec.com]
Sent: 2017年2月10日 22:21
To: Michelle Gu (micgu) <mgu at nds.com>
Cc: Alon Shaltiel (ashaltie) <ashaltie at cisco.com>
Subject: RE: Clang compiling needs help
Hi,
My apologies, I spoke too soon. I'd forgotten that I also patched clang recently to invoke the assembler correctly when -mno-abicalls is passed to clang. Existing releases of clang will always pass -call_nonpic to an external MIPS assembler. You could checkout the live svn repository and build that (http://www.llvm.org/docs/GettingStarted.html,
you'll need both llvm and clang) and use it to compile for MIPS. In that case, I'd recommend using the integrated assembler (which is on by default for MIPS32).
Apologies again,
Simon
> -----Original Message-----
> From: cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] On Behalf Of
> Simon Dardis via cfe-dev
> Sent: 10 February 2017 13:45
> To: Michelle Gu (micgu); cfe-dev at lists.llvm.org
> Cc: Alon Shaltiel (ashaltie)
> Subject: Re: [cfe-dev] Clang compiling needs help
>
> Hi,
>
> You need to use 'fno-pic -mno-abicalls -fno-integrated-as' to get the
> output you're looking for I believe. It does require the use of the
> GNU assembler, which may require specifying the sysroot of your gcc
> installation so clang finds the assembler and/or making a symlink 'mipsel-as' to your mips-elf-as.
>
> Hopefully that should work around the warning. I don't have any other
> suggestions with the output you've posted.
>
> -mno-abicalls with -fintegrated-as should be properly supported in the
> next release after 4.0.
>
> Thanks,
> Simon
> ________________________________________
> From: Michelle Gu (micgu) [mgu at nds.com]
> Sent: 10 February 2017 02:07
> To: Simon Dardis; cfe-dev at lists.llvm.org
> Cc: Alon Shaltiel (ashaltie)
> Subject: RE: Clang compiling needs help
>
> Hi Simon,
>
> Thank you for your feedback!
>
> First, I delete '-fno-pic -mabicalls' options and rerun the compiling,
> the error result is same as before. I doubt if these options work or not.
> Second, when I tried to link my lib with other projects, I can see
> compile option ' WITHOUT_WERROR=1' during compiling. I think that
> means it's not the problem of warnings became errors.
>
> Do you have any other suggestion?
>
> BR,
> Michelle
>
> -----Original Message-----
> From: Simon Dardis [mailto:Simon.Dardis at imgtec.com]
> Sent: 2017年2月7日 22:04
> To: Michelle Gu (micgu) <mgu at nds.com>; cfe-dev at lists.llvm.org
> Cc: Alon Shaltiel (ashaltie) <ashaltie at cisco.com>
> Subject: RE: Clang compiling needs help
>
> The "warning: linking abicalls files with non-abicalls files" warning
> is almost certainly arising from a long standing LLVM bug where all
> files produced from the integrated assembler for MIPS were marked as
> being abicalls files. It's fixed on ToT.
>
> In theory the produced binary should be fine, as the error is
> occurring from incorrect ELF header flags. The error from 'make' may
> be due to treating warnings as errors.
>
> The CFLAGS you've specified appear to be inconsistent with your
> mips-elf target. "-fno-pic -mabicalls"
> produces position dependant code that can call position independent code.
> This would be for environments such as Linux/BSDs/etc. mips-elf I
> expect is a bare-metal environment, so -mabicalls would not be used for that target.
>
> Thanks,
> Simon
>
>
>
>
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
More information about the cfe-dev
mailing list