All of lore.kernel.org
 help / color / mirror / Atom feed
* link error while u-boot-spl build : undefined ref to `printf` or `strcmp` etc.
@ 2021-11-21 11:45 Chan Kim
  2021-11-21 15:30 ` Ovidiu Panait
  0 siblings, 1 reply; 3+ messages in thread
From: Chan Kim @ 2021-11-21 11:45 UTC (permalink / raw)
  To: U-Boot Mailing List

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

 

Thank you.

Chan Kim


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: link error while u-boot-spl build : undefined ref to `printf` or `strcmp` etc.
  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
  2021-11-22  0:42   ` Chan Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Ovidiu Panait @ 2021-11-21 15:30 UTC (permalink / raw)
  To: Chan Kim, U-Boot Mailing List

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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: link error while u-boot-spl build : undefined ref to `printf` or `strcmp` etc.
  2021-11-21 15:30 ` Ovidiu Panait
@ 2021-11-22  0:42   ` Chan Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Chan Kim @ 2021-11-22  0:42 UTC (permalink / raw)
  To: 'Ovidiu Panait', 'U-Boot Mailing List'

Hi Ovidiu,

Thank you so much, with those two configs added, u-boot-spl was finally built ok
(The remaining 3 or 4 link errors are all gone together)
Thank you,

Best regards,
Chan Kim

> -----Original Message-----
> From: Ovidiu Panait <ovidiu.panait@windriver.com>
> Sent: Monday, November 22, 2021 12:30 AM
> 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.
> 
> 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
> >





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-22  0:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-11-22  0:42   ` Chan Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.