public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ovidiu Panait <ovidiu.panait@windriver.com>
To: Chan Kim <ckim@etri.re.kr>, U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: link error while u-boot-spl build : undefined ref to `printf` or `strcmp` etc.
Date: Sun, 21 Nov 2021 17:30:05 +0200	[thread overview]
Message-ID: <e9fe126a-920d-9cbf-8be1-3c40c210209f@windriver.com> (raw)
In-Reply-To: <008a01d7decd$3f3c0900$bdb41b00$@etri.re.kr>

Hi Chan,

On 11/21/21 1:45 PM, Chan Kim wrote:
> [Please note: This e-mail is from an EXTERNAL e-mail address]
>
> Hello,
>
> When I build u-boot, I get this error at the end. (during u-boot-spl build).
>
> I've been fixing some link errors by adding config values but I can't figure
> out what is wrong with this.
>
> Below is the final command for u-boot-spl build and the error messages.
>
> Can any expert tell me what can be wrong here?
>
>
>
> ( cd spl && aarch64-none-elf-gcc -nostdlib -nostartfiles
> -fuse-linker-plugin -flto=28 -Wall -Wstrict-prototypes -Wno-format-security
> -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing
> -fno-PIE -Os  -flto=28 -fno-stack-protector -fno-delete-null-pointer-checks
> -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds
> -Wno-array-bounds -Wno-stringop-overflow -Wno-maybe-uninitialized
> -fmacro-prefix-map=./= -g -fstack-usage -Wno-format-nonliteral
> -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=date-time
> -Wno-packed-not-aligned  -ffunction-sections -fdata-sections
> -fno-stack-protector -D__KERNEL__ -D__UBOOT__  -DCONFIG_SPL_BUILD  -D__ARM__
> -mstrict-align  -fno-common -ffixed-r9  -mgeneral-regs-only    -fno-common
> -ffixed-x18 -pipe -march=armv8-a+crc -D__LINUX_ARM_ARCH__=8   -Ispl/include
> -Iinclude   -I./arch/arm/include -include ./include/linux/kconfig.h
> -nostdinc -isystem
> /opt/arm-toolchains/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin/../lib/
> gcc/aarch64-none-elf/10.2.1/include  -Wl,-T -Wl,u-boot-spl.lds
> -Wl,--gc-sections -Wl,-Bstatic -Wl,--gc-sections -Wl,--no-dynamic-linker
> -Wl,--build-id=none -Wl,-Ttext -Wl,0x4000000 arch/arm/cpu/armv8/start.o
> -Wl,--whole-archive arch/arm/cpu/armv8/built-in.o arch/arm/cpu/built-in.o
> arch/arm/lib/built-in.o board/etri/ab21m/built-in.o common/spl/built-in.o
> common/init/built-in.o common/built-in.o cmd/built-in.o env/built-in.o
> disk/built-in.o drivers/built-in.o dts/built-in.o fs/built-in.o
> keep-syms-lto.o -L
> /opt/arm-toolchains/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin/../lib/
> gcc/aarch64-none-elf/10.2.1 -lgcc -Wl,--no-whole-archive
> -Wl,-Map,u-boot-spl.map -o u-boot-spl )
>
> /opt/arm-toolchains/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin/../lib/
> gcc/aarch64-none-elf/10.2.1/../../../../aarch64-none-elf/bin/ld:
> /tmp/u-boot-spl.GeKfJh.ltrans0.ltrans.o: in function `alloc_simple':
>
> /home/ckim/U-BOOT/u-boot/spl/../common/malloc_simple.c:29: undefined
> reference to `printf'
>
> /opt/arm-toolchains/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin/../lib/
> gcc/aarch64-none-elf/10.2.1/../../../../aarch64-none-elf/bin/ld:
> /tmp/u-boot-spl.GeKfJh.ltrans0.ltrans.o: in function `device_bind_by_name':
>
> /home/ckim/U-BOOT/u-boot/spl/../drivers/core/lists.c:31: undefined reference
> to `strcmp'
>
> /opt/arm-toolchains/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin/../lib/
> gcc/aarch64-none-elf/10.2.1/../../../../aarch64-none-elf/bin/ld:
> /tmp/u-boot-spl.GeKfJh.ltrans0.ltrans.o: in function `board_init_r':
>
> /home/ckim/U-BOOT/u-boot/spl/../common/spl/spl.c:697: undefined reference to
> `timer_init'
>
> /opt/arm-toolchains/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin/../lib/
> gcc/aarch64-none-elf/10.2.1/../../../../aarch64-none-elf/bin/ld:
> /home/ckim/U-BOOT/u-boot/spl/../common/spl/spl.c:690: undefined reference to
> `hang'
>
> /opt/arm-toolchains/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin/../lib/
> gcc/aarch64-none-elf/10.2.1/../../../../aarch64-none-elf/bin/ld:
> /home/ckim/U-BOOT/u-boot/spl/../common/spl/spl.c:633: undefined reference to
> `printf'
>
> collect2: error: ld returned 1 exit status
>
> make[1]: *** [scripts/Makefile.spl:509: spl/u-boot-spl] Error 1
>
> make: *** [Makefile:1984: spl/u-boot-spl] Error 2

Could you try to enable CONFIG_SPL_LIBCOMMON_SUPPORT and 
CONFIG_SPL_LIBGENERIC_SUPPORT Kconfig options?


Ovidiu

>
>
> Thank you.
>
> Chan Kim
>

  reply	other threads:[~2021-11-21 15:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-21 11:45 link error while u-boot-spl build : undefined ref to `printf` or `strcmp` etc Chan Kim
2021-11-21 15:30 ` Ovidiu Panait [this message]
2021-11-22  0:42   ` Chan Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e9fe126a-920d-9cbf-8be1-3c40c210209f@windriver.com \
    --to=ovidiu.panait@windriver.com \
    --cc=ckim@etri.re.kr \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox