[llvmlinux] Assembler error: junk at end of file... cross-compiling for arm64

dotweiba dotweiba at gmail.com
Fri Apr 22 12:08:38 UTC 2016


Having forgotten to CC all of you, perhaps I should post the detailed mail on the mailing list . XD

> 在 2016年4月22日,17:20,Renato Golin <renato.golin at linaro.org> 写道:
> 
> On 20 April 2016 at 06:26, dotweiba <dotweiba at gmail.com> wrote:
>> /tmp/psci-5f0b3d.s: Assembler messages:
>> /tmp/psci-5f0b3d.s:2049: Error: .err encountered
>> /tmp/psci-5f0b3d.s:2050: Error: .err encountered
>> /tmp/psci-5f0b3d.s:2051: Error: .err encountered
>> /tmp/psci-5f0b3d.s:2052: Error: .err encountered
>> /tmp/psci-5f0b3d.s:2116: Error: .err encountered
>> /tmp/psci-5f0b3d.s:2117: Error: .err encountered
>> /tmp/psci-5f0b3d.s:2118: Error: .err encountered
>> /tmp/psci-5f0b3d.s:2119: Error: .err encountered
>> clang: error: assembler command failed with exit code 1 (use -v to see invocation)
>> make[2]: *** [arch/arm64/kernel/psci.o] Error 1
>> 
>> It seemed that the right aarch64-linux-gnu-as was called and the compiling progress went further.
> 
> Yes, this seems like the kind of bug the LLVMLinux guys are better at
> identifying. :)
> 
> IIRC, this file was problematic in the past...
> 
> cheers,
> --renato

Details:
> 在 2016年4月20日,13:26,dotweiba <dotweiba at gmail.com> 写道:
> 
> I guess I should append “-Xassembler -v” to AFLAGS_KERNEL and AFLAGS_MODULE in Makefile.
> So in big “M” Makefile:
> 	AFLAGS_KERNEL := -Xassembler -v
> 	AFLAGS_MODULE := -Xassembler -v
> In little “m” makefile:
> 	HOSTCC          :=/home/cas/toolchain/clang+llvm-3.5.0-x86_64-linux-gnu/bin/clang
> 	CC 			 :=/home/cas/toolchain/clang+llvm-3.5.0-x86_64-linux-gnu/bin/clang
> 	ARCH 		 := arm64 
> 	CROSS_COMPILE := /home/cas/toolchain/gcc-linaro-aarch64-linux-gnu-4.9-2014.08_linux/bin/aarch64-linux-gnu- 
> 
> Neglecting warnings during HOSTCC scripts/*.o files, I got this:
> 
> CC      arch/arm64/kernel/psci.o
> GNU assembler version 2.24.0 (aarch64-linux-gnu) using BFD version (crosstool-NG linaro-1.13.1-4.9-2014.08 - Linaro GCC 4.9-2014.08) 2.24.0.20140801 Linaro 2014.08
> /tmp/psci-5f0b3d.s: Assembler messages:
> /tmp/psci-5f0b3d.s:2049: Error: .err encountered
> /tmp/psci-5f0b3d.s:2050: Error: .err encountered
> /tmp/psci-5f0b3d.s:2051: Error: .err encountered
> /tmp/psci-5f0b3d.s:2052: Error: .err encountered
> /tmp/psci-5f0b3d.s:2116: Error: .err encountered
> /tmp/psci-5f0b3d.s:2117: Error: .err encountered
> /tmp/psci-5f0b3d.s:2118: Error: .err encountered
> /tmp/psci-5f0b3d.s:2119: Error: .err encountered
> clang: error: assembler command failed with exit code 1 (use -v to see invocation)
> make[2]: *** [arch/arm64/kernel/psci.o] Error 1
> 
> It seemed that the right aarch64-linux-gnu-as was called and the compiling progress went further.
> 
>> 在 2016年4月19日,17:41,Renato Golin <renato.golin at linaro.org> 写道:
>> 
>> Looks like it's picking the host assembler instead of the target one.
>> Try running the command with -v and see if it is choosing /usr/bin/as
>> instead of some aarch64-linux-gnueabihf-as.
>> 
>> cheers,
>> --renato
>> 
>> On 19 April 2016 at 02:29, dotweiba <dotweiba at gmail.com> wrote:
>>> Hi all,
>>> I am doing cross-compiling LLVMLinux for arm64 platform with the purpose of
>>> generating some *.bc files to analysis. So I followed the procedure as
>>> below:
>>> 1-> git clone git://git.linuxfoundation.org/llvmlinux/kernel.git
>>> 2-> downloaded little ‘m’ makefile and change ARCH, CROSS_COMPILE, CC and
>>> HOSTCC
>>> 3-> make memuconfig && make
>>> 
>>> But something weird happened:
>>> 
>>>>>> 
>>> 2 warnings generated.
>>> HOSTCC  scripts/dtc/util.o
>>> HOSTCC  scripts/dtc/dtc-lexer.lex.o
>>> HOSTCC  scripts/dtc/dtc-parser.tab.o
>>> HOSTLD  scripts/dtc/dtc
>>> HOSTCC  scripts/genksyms/genksyms.o
>>> HOSTCC  scripts/genksyms/parse.tab.o
>>> HOSTCC  scripts/genksyms/lex.lex.o
>>> HOSTLD  scripts/genksyms/genksyms
>>> CC      scripts/mod/empty.o
>>> /tmp/empty-1a3667.s: Assembler messages:
>>> /tmp/empty-1a3667.s:28: Error: bad expression
>>> /tmp/empty-1a3667.s:28: Warning: division by zero
>>> /tmp/empty-1a3667.s:28: Error: junk at end of line, first unrecognized
>>> character is `L'
>>> /tmp/empty-1a3667.s:29: Error: bad expression
>>> /tmp/empty-1a3667.s:29: Warning: division by zero
>>> /tmp/empty-1a3667.s:29: Error: junk at end of line, first unrecognized
>>> character is `D'
>>> /tmp/empty-1a3667.s:30: Error: bad expression
>>> /tmp/empty-1a3667.s:30: Error: junk at end of line, first unrecognized
>>> character is `O’
>>>>>> 
>>> I tried to figure out what was wrong. And for native compiling (HOST=Clang
>>> CC=Clang) it goes all right.
>>> So I wonder if it is the dependency problem as you said
>>> “Yes, there is still a dependency on parts of the gcc toolchain. Most
>>> notably ld, as, and sometimes libgcc.”
>>> 
>>> Any help? I would appreciate it a lot.
>>> 
>>> _______________________________________________
>>> LLVMLinux mailing list
>>> LLVMLinux at lists.linuxfoundation.org
>>> https://lists.linuxfoundation.org/mailman/listinfo/llvmlinux
> 



More information about the LLVMLinux mailing list