1

I am facing some linker issues in ARM DS IDE, i am trying build code for ARMVv-8 architecture, Cortex A72 processor with ARM Compiler 6.

I think those error are related to standard libraries like stdio.h ,math.h these errors should not come as linker always looks for standard libraries paths on Linux machine.

Am i missing something or making some compiler, linker mistake ?

Building target: fresample.axf
Invoking: Arm Linker 6
armlink --userlibpath=/usr/lib/x86_64-linux-gnu --info=sizes -o "fresample.axf"  ./src/audio.o ./src/audio_format.o ./src/audio_rate.o ./src/audio_raw_load.o ./src/audio_wav_check.o ./src/audio_wav_load.o ./src/audio_wav_save.o ./src/common.o ./src/file.o ./src/main.o ./src/riff.o  ./lib/cpu.o ./lib/filter_delay.o ./lib/filter_free.o ./lib/filter_get.o ./lib/filter_new.o ./lib/filter_new_window.o ./lib/info_name.o ./lib/param.o ./lib/param_name.o ./lib/resample.o ./lib/resample_s16func.o ./lib/resample_s16n1f32_altivec.o ./lib/resample_s16n1f32_scalar.o ./lib/resample_s16n1f32_sse2.o ./lib/resample_s16n1s16_altivec.o ./lib/resample_s16n1s16_scalar.o ./lib/resample_s16n1s16_sse2.o ./lib/resample_s16n2f32_altivec.o ./lib/resample_s16n2f32_scalar.o ./lib/resample_s16n2f32_sse2.o ./lib/resample_s16n2s16_altivec.o ./lib/resample_s16n2s16_scalar.o ./lib/resample_s16n2s16_sse2.o ./lib/swap16.o ./lib/swap16_scalar.o   
Error: L6218E: Undefined symbol stderr (referred from common.o).
Error: L6218E: Undefined symbol close (referred from file.o).
Error: L6218E: Undefined symbol fstat (referred from file.o).
Error: L6218E: Undefined symbol mmap (referred from file.o).
Error: L6218E: Undefined symbol munmap (referred from file.o).
Error: L6218E: Undefined symbol open (referred from file.o).
Error: L6218E: Undefined symbol read (referred from file.o).
Error: L6218E: Undefined symbol __assert_fail (referred from main.o).
Error: L6218E: Undefined symbol getopt_long (referred from main.o).
Error: L6218E: Undefined symbol optarg (referred from main.o).
Error: L6218E: Undefined symbol optind (referred from main.o).
Error: L6218E: Undefined symbol optopt (referred from main.o).
Error: L6218E: Undefined symbol stdout (referred from main.o).
Error: L6218E: Undefined symbol __exp_finite (referred from filter_new.o).
Error: L6218E: Undefined symbol __log_finite (referred from filter_new.o).
Error: L6218E: Undefined symbol __pow_finite (referred from filter_new.o).
Error: L6218E: Undefined symbol __sqrt_finite (referred from filter_new.o).
Finished: 0 information, 0 warning and 17 error messages.
make: *** [makefile:33: fresample.axf] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
nilesh
  • 55
  • 10
  • `--userlibpath=/usr/lib/x86_64-linux-gnu` I wonder, if you are compiling for ARMv8, why do you use anything from x86_64. Yes, you are missing those functions. Either link with an implementation from some library or implement those functions yourself. `newlib` is commonly used in embedded applications. `as linker always looks for standard libraries paths on Linux machine.` no, x86_64 is not armv8. You can't use libraries for x86_64 on armv8. – KamilCuk May 02 '20 at 08:17
  • Just a thought: I don't know the development environment that you're using, and I'm not sure that I understand the problem, but I have run into similar problems whenever I move code from one environment to another. What I have done without thinking is run a command like "make myprog.exe": the compile command in the makefile is referencing object files (*.o) that were copied over with the source code, but these object files were compiled in the other environment, from which the source was copied. When I delete all the *.o files and recompile, everything works fine. – Thomas Hedden Nov 28 '21 at 17:47

2 Answers2

1

It’s necessary to have GCC in order to build Linux application with ARM Compiler 6: the reason is that ARM Compiler 6 does not include Linux libraries so it needs to use glibc from GCC.

Here is the link: https://community.arm.com/developer/tools-software/tools/b/tools-software-ides-blog/posts/building-an-armv8-linux-hello-world-with-arm-compiler-6

nilesh
  • 55
  • 10
0

I think there's no need to specify libpath in your case. There're C libraries for Arm come with Arm compiler by default.

cartman
  • 732
  • 2
  • 8
  • 20