From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Salter To: NarayVA@nsc-msg01.network.com Cc: gthomas@cambridge.redhat.com, ecos-discuss@sourceware.cygnus.com, ecos-discuss@sourceware.cygnus.com, jlarmour@redhat.com Subject: Re: [ECOS] Help! on building ecosconfigure Date: Thu, 19 Apr 2001 12:40:00 -0000 Message-id: <200104191943.f3JJhFr24942@deneb.localdomain> References: X-SW-Source: 2001-04/msg00218.html >>>>> Narayana, Venkat A writes: > Why am i getting these new errors/ does my path is bad? > And why did in the mixed up case of gcc and ld, binaries got built. > ___Start____ > redboot_net_io.o(.text+0xa00): undefined reference to `puts' > redboot_net_io.o(.text+0xa4c): undefined reference to `puts' > /home/users/redboot.ROM/install/lib/libtarget.a(io_flash_flash.o): In > function `flash_erase': > io_flash_flash.o(.text+0x2c8): undefined reference to `putchar' > io_flash_flash.o(.text+0x2e0): undefined reference to `putchar' > /home/users/redboot.ROM/install/lib/libtarget.a(io_flash_flash.o): In > function `flash_program' > ___End___ Hmm, I saw this on another architecture that uses a recent gcc. The problem is with gcc builtins. Gcc "optimizes" things like: printf("foo") ==> puts("foo") and printf("\n") ==> putchar('\n') Of course, RedBoot doesn't provide putchar or puts, so you get link errors. Try this patch which adds -fno-builtin to the compile line. --Mark Index: hal_arm_iq80310.cdl =================================================================== RCS file: /home/cvs/ecc/ecc/hal/arm/iq80310/current/cdl/hal_arm_iq80310.cdl,v retrieving revision 1.14 diff -u -p -5 -c -r1.14 hal_arm_iq80310.cdl cvs server: conflicting specifications of output style *** hal_arm_iq80310.cdl 2001/04/17 14:42:58 1.14 --- hal_arm_iq80310.cdl 2001/04/19 19:35:59 *************** cdl_package CYGPKG_HAL_ARM_IQ80310 { *** 192,202 **** cdl_option CYGBLD_GLOBAL_CFLAGS { display "Global compiler flags" flavor data no_define ! default_value { "-Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority -mapcs-frame" } description " This option controls the global compiler flags which are used to compile all packages by default. Individual packages may define options which override these global flags." } --- 192,202 ---- cdl_option CYGBLD_GLOBAL_CFLAGS { display "Global compiler flags" flavor data no_define ! default_value { "-fno-builtin -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority -mapcs-frame" } description " This option controls the global compiler flags which are used to compile all packages by default. Individual packages may define options which override these global flags." }