I'm experiencing the problem shown below when trying to build coreboot release 3324 for Geode LX evaluation board db800 on 64-bit host. It seems ld is not invoked properly. Anybody can help me? Thanks in advance.
[llandre@linuxserver2 targets]$ ./buildtarget amd/db800 build_dir=amd/db800/db800 Configuring TARGET db800 Will place Makefile, crt0.S, etc. in amd/db800/db800 Configuring ROMIMAGE fallback Curimage 0 Curpart is 0
Configuring DIR /config/Config.lb Configuring DIR /lib/Config.lb Configuring DIR /console/Config.lb Configuring DIR /stream/Config.lb Configuring DIR /devices/Config.lb Configuring DIR /pc80/Config.lb Configuring DIR /boot/Config.lb SETTING ARCH i386
Adding init file: init/crt0.S.lb Configuring DIR lib/Config.lb Configuring DIR boot/Config.lb Configuring DIR /pc80/Config.lb ===> WARNING: object/driver mc146818rtc previously defined ===> WARNING: object/driver isa-dma previously defined ===> WARNING: object/driver i8259 previously defined ===> WARNING: object/driver keyboard previously defined Configuring DIR /cpu/x86/tsc/Config.lb Configuring DIR /cpu/x86/fpu/Config.lb Configuring DIR /cpu/x86/mmx/Config.lb Configuring DIR /cpu/x86/lapic/Config.lb Configuring DIR /cpu/x86/cache/Config.lb End ROMIMAGE Build ROM size 487424 Verifying ROMIMAGE fallback Verifing global options Creating amd/db800/db800/fallback/static.c Creating amd/db800/db800/fallback/Makefile.settings Creating amd/db800/db800/fallback/crt0_includes.h Creating amd/db800/db800/fallback/Makefile Creating amd/db800/db800/fallback/ldoptions Creating amd/db800/db800/Makefile.settings Creating amd/db800/db800/Makefile Usage: /usr/bin/ld [options] file... Options: -a KEYWORD Shared library control for HP/UX compatibility -A ARCH, --architecture ARCH Set architecture -b TARGET, --format TARGET Specify target for following input files -c FILE, --mri-script FILE Read MRI format linker script -d, -dc, -dp Force common symbols to be defined -e ADDRESS, --entry ADDRESS Set start address -E, --export-dynamic Export all dynamic symbols -EB Link big-endian objects -EL Link little-endian objects -f SHLIB, --auxiliary SHLIB Auxiliary filter for shared object symbol table -F SHLIB, --filter SHLIB Filter for shared object symbol table -g Ignored -G SIZE, --gpsize SIZE Small data size (if no size, same as --shared) -h FILENAME, -soname FILENAME Set internal name of shared library -I PROGRAM, --dynamic-linker PROGRAM Set PROGRAM as the dynamic linker to use -l LIBNAME, --library LIBNAME Search for library LIBNAME -L DIRECTORY, --library-path DIRECTORY Add DIRECTORY to library search path -m EMULATION Set emulation -M, --print-map Print map file on standard output -n, --nmagic Do not page align data -N, --omagic Do not page align data, do not make text readonly --no-omagic Page align data, make text readonly -o FILE, --output FILE Set output file name -O Optimize output file -Qy Ignored for SVR4 compatibility -q, --emit-relocs Generate relocations in final output -r, -i, --relocatable Generate relocatable output -R FILE, --just-symbols FILE Just link symbols (if directory, same as --rpath) -s, --strip-all Strip all symbols -S, --strip-debug Strip debugging symbols --strip-discarded Strip symbols in discarded sections --no-strip-discarded Do not strip symbols in discarded sections -t, --trace Trace file opens -T FILE, --script FILE Read linker script -u SYMBOL, --undefined SYMBOL Start with undefined reference to SYMBOL --unique [=SECTION] Don't merge input [SECTION | orphan] sections -Ur Build global constructor/destructor tables -v, --version Print version information -V Print version and emulation information -x, --discard-all Discard all local symbols -X, --discard-locals Discard temporary local symbols (default) --discard-none Don't discard any local symbols -y SYMBOL, --trace-symbol SYMBOL Trace mentions of SYMBOL -Y PATH Default search path for Solaris compatibility -(, --start-group Start a group -), --end-group End a group --accept-unknown-input-arch Accept input files whose architecture cannot be determined --no-accept-unknown-input-arch Reject input files whose architecture is unknown -assert KEYWORD Ignored for SunOS compatibility -Bdynamic, -dy, -call_shared Link against shared libraries -Bstatic, -dn, -non_shared, -static Do not link against shared libraries -Bsymbolic Bind global references locally --check-sections Check section addresses for overlaps (default) --no-check-sections Do not check section addresses for overlaps --cref Output cross reference table --defsym SYMBOL=EXPRESSION Define a symbol --demangle [=STYLE] Demangle symbol names [using STYLE] --demangler DSO:FUNCTION Set DSO and demangler function --embedded-relocs Generate embedded relocs -fini SYMBOL Call SYMBOL at unload-time --force-exe-suffix Force generation of file with .exe suffix --gc-sections Remove unused sections (on some targets) --no-gc-sections Don't remove unused sections (default) --hash-size=<NUMBER> Set default hash table size close to <NUMBER> --help Print option help -init SYMBOL Call SYMBOL at load-time -Map FILE Write a map file --no-define-common Do not define Common storage --no-demangle Do not demangle symbol names --no-keep-memory Use less memory and more disk I/O --no-undefined Do not allow unresolved references in object files --allow-shlib-undefined Allow unresolved references in shared libaries --no-allow-shlib-undefined Do not allow unresolved references in shared libs --allow-multiple-definition Allow multiple definitions --no-undefined-version Disallow undefined version --no-warn-mismatch Don't warn about mismatched input files --no-whole-archive Turn off --whole-archive --noinhibit-exec Create an output file even if errors occur -nostdlib Only use library directories specified on the command line --oformat TARGET Specify target of output file -qmagic Ignored for Linux compatibility --reduce-memory-overheads Reduce memory overheads, possibly taking much longer --relax Relax branches on certain targets --retain-symbols-file FILE Keep only symbols listed in FILE -rpath PATH Set runtime shared library search path -rpath-link PATH Set link time shared library search path -shared, -Bshareable Create a shared library -pie, --pic-executable Create a position independent executable --sort-common Sort common symbols by size --spare-dynamic-tags COUNT How many tags to reserve in .dynamic section --split-by-file [=SIZE] Split output sections every SIZE octets --split-by-reloc [=COUNT] Split output sections every COUNT relocs --stats Print memory usage statistics --target-help Display target specific options --task-link SYMBOL Do task level linking --traditional-format Use same format as native linker --section-start SECTION=ADDRESS Set address of named section -Tbss ADDRESS Set address of .bss section -Tdata ADDRESS Set address of .data section -Ttext ADDRESS Set address of .text section --unresolved-symbols=<method> How to handle unresolved symbols. <method> is: ignore-all, report-all, ignore-in-object-files, ignore-in-shared-libs --verbose Output lots of information during link --version-script FILE Read version information script --version-exports-section SYMBOL Take export symbols list from .exports, using SYMBOL as the version. --warn-common Warn about duplicate common symbols --warn-constructors Warn if global constructors/destructors are seen --warn-multiple-gp Warn if the multiple GP values are used --warn-once Warn only once per undefined symbol --warn-section-align Warn if start of section changes due to alignment --warn-unresolved-symbols Report unresolved symbols as warnings --error-unresolved-symbols Report unresolved symbols as errors --fatal-warnings Treat warnings as errors --whole-archive Include all objects from following archives --add-needed Set DT_NEEDED tags for DT_NEEDED entries in following dynamic libs --no-add-needed Do not set DT_NEEDED tags for DT_NEEDED entries in following dynamic libs --as-needed Only set DT_NEEDED for following dynamic libs if used --no-as-needed Always set DT_NEEDED for following dynamic libs --wrap SYMBOL Use wrapper functions for SYMBOL /usr/bin/ld: supported targets: elf64-x86-64 elf32-i386 a.out-i386-linux efi-app-ia32 elf64-little elf64-big elf32-little elf32-big srec symbolsrec tekhex binary ihex /usr/bin/ld: supported emulations: elf_x86_64 elf_i386 i386linux /usr/bin/ld: emulation specific options: elf_x86_64: -Bgroup Selects group name lookup rules for DSO --disable-new-dtags Disable new dynamic tags --enable-new-dtags Enable new dynamic tags --eh-frame-hdr Create .eh_frame_hdr section -z combreloc Merge dynamic relocs into one section and sort -z defs Report unresolved symbols in object files. -z execstack Mark executable as requiring executable stack -z initfirst Mark DSO to be initialized first at runtime -z interpose Mark object to interpose all DSOs but executable -z loadfltr Mark object requiring immediate process -z muldefs Allow multiple definitions -z nocombreloc Don't merge dynamic relocs into one section -z nocopyreloc Don't create copy relocs -z nodefaultlib Mark object not to use default search paths -z nodelete Mark DSO non-deletable at runtime -z nodlopen Mark DSO not available to dlopen -z nodump Mark DSO not available to dldump -z noexecstack Mark executable as not requiring executable stack -z norelro Don't create RELRO program header -z now Mark object non-lazy runtime binding -z origin Mark object requiring immediate $ORIGIN processing at runtime -z relro Create RELRO program header -z KEYWORD Ignored for Solaris compatibility elf_i386: -Bgroup Selects group name lookup rules for DSO --disable-new-dtags Disable new dynamic tags --enable-new-dtags Enable new dynamic tags --eh-frame-hdr Create .eh_frame_hdr section -z combreloc Merge dynamic relocs into one section and sort -z defs Report unresolved symbols in object files. -z execstack Mark executable as requiring executable stack -z initfirst Mark DSO to be initialized first at runtime -z interpose Mark object to interpose all DSOs but executable -z loadfltr Mark object requiring immediate process -z muldefs Allow multiple definitions -z nocombreloc Don't merge dynamic relocs into one section -z nocopyreloc Don't create copy relocs -z nodefaultlib Mark object not to use default search paths -z nodelete Mark DSO non-deletable at runtime -z nodlopen Mark DSO not available to dlopen -z nodump Mark DSO not available to dldump -z noexecstack Mark executable as not requiring executable stack -z norelro Don't create RELRO program header -z now Mark object non-lazy runtime binding -z origin Mark object requiring immediate $ORIGIN processing at runtime -z relro Create RELRO program header -z KEYWORD Ignored for Solaris compatibility
Supported demangler style: {none,auto,gnu,lucid,arm,hp,edg,gnu-v3,java,gnat,compaq}
Report bugs to URL:http://www.sourceware.org/bugzilla/ and hjl@lucon.org
On Fri, May 16, 2008 at 02:55:38PM +0200, llandre wrote:
I'm experiencing the problem shown below when trying to build coreboot release 3324 for Geode LX evaluation board db800 on 64-bit host. It seems ld is not invoked properly.
..
Usage: /usr/bin/ld [options] file...
..
/usr/bin/ld: supported targets: elf64-x86-64 elf32-i386 a.out-i386-linux efi-app-ia32 elf64-little elf64-big elf32-little elf32-big srec symbolsrec tekhex binary ihex
It seems your ld will prefer/default to elf64-x86-64, and the options specified in the build scripts are possibly only available for elf32-i386.
Maybe --oformat elf32-i386 in the ld command line will help?
//Peter
I'm experiencing the problem shown below when trying to build coreboot release 3324 for Geode LX evaluation board db800 on 64-bit host. It seems ld is not invoked properly.
..
Usage: /usr/bin/ld [options] file...
..
/usr/bin/ld: supported targets: elf64-x86-64 elf32-i386 a.out-i386-linux efi-app-ia32 elf64-little elf64-big elf32-little elf32-big srec symbolsrec tekhex binary ihex
It seems your ld will prefer/default to elf64-x86-64, and the options specified in the build scripts are possibly only available for elf32-i386.
Maybe --oformat elf32-i386 in the ld command line will help?
I changed the file src/config/Config.lb like this:
----------------------------------------------------------- makerule coreboot depends "crt0.o $(INIT-OBJECTS) $(COREBOOT_APC) $(COREBOOT_RAM_ROM) ldscript.ld" action "$(CC) $(DISTRO_LFLAGS) -nostdlib -nostartfiles -static --oformat elf32-i386 -o $@ -T ldscript.ld crt0.o $(INIT-OBJECTS)" action "$(CROSS_COMPILE)nm -n coreboot | sort > coreboot.map" end -----------------------------------------------------------
The file targets/amd/db800/db800/fallback/Makefile is generated accordingly:
----------------------------------------------------------- coreboot: crt0.o $(INIT-OBJECTS) $(COREBOOT_APC) $(COREBOOT_RAM_ROM) ldscript.ld $(CC) $(DISTRO_LFLAGS) -nostdlib -nostartfiles -static --oformat elf32-i386 -o $@ -T ldscript.ld crt0.o $(INIT-OBJECTS) $(CROSS_COMPILE)nm -n coreboot | sort > coreboot.map -----------------------------------------------------------
but linker still does not like it :(
llandre wrote:
I changed the file src/config/Config.lb like this:
makerule coreboot depends "crt0.o $(INIT-OBJECTS) $(COREBOOT_APC) $(COREBOOT_RAM_ROM) ldscript.ld" action "$(CC) $(DISTRO_LFLAGS) -nostdlib -nostartfiles -static --oformat elf32-i386 -o $@ -T ldscript.ld crt0.o $(INIT-OBJECTS)" action "$(CROSS_COMPILE)nm -n coreboot | sort > coreboot.map" end
what about setting DISTRO_LFLAGS to -m32 ?
what about setting DISTRO_LFLAGS to -m32 ?
I added in targets/buildtarget the following lines but it did not work :(
EXTRA_CFLAGS=-m32 EXTRA_LFLAGS=-m32
However I tried to build coreboot with buildrom on the same machine and it worked fine. Where do I have to look to understand how buildrom configures coreboot before building it?
-----Original Message----- From: coreboot-bounces@coreboot.org [mailto:coreboot-bounces@coreboot.org] On Behalf Of llandre Sent: Friday, May 16, 2008 8:58 AM To: Stefan Reinauer Cc: peter@stuge.se; coreboot@coreboot.org Subject: Re: [coreboot] Building coreboot on 64-bit host
what about setting DISTRO_LFLAGS to -m32 ?
I added in targets/buildtarget the following lines but it did not work :(
EXTRA_CFLAGS=-m32 EXTRA_LFLAGS=-m32
However I tried to build coreboot with buildrom on the same machine and it worked fine. Where do I have to look to understand how buildrom configures coreboot before building it?
Here are some places to look (more or less in order):
scripts/Build.settings packages/coreboot-v2/coreboot.inc packages/coreboot-v2/*.mk Makefile
Thanks, Myles
It was a false alarm ... IIUC buildtarget script performs some tries to guess proper parameters to pass to linker. Thus the error messages printed by the linker refers to one on these attempts. The Mkefiles and stuff are generated correctly anyway.
Sorry for bothering you and thank you again for your support.
On Mon, May 19, 2008 at 2:29 AM, llandre r&d2@dave-tech.it wrote:
It was a false alarm ... IIUC buildtarget script performs some tries to guess proper parameters to pass to linker. Thus the error messages printed by the linker refers to one on these attempts. The Mkefiles and stuff are generated correctly anyway.
thanks for telling us about these types of messages. I will be testing builds on 64 bit too, and this type of info is *extremely* helpful. Please keep telling us when you hit these glitches!
thanks
ron
It was a false alarm ... IIUC buildtarget script performs some tries to guess proper parameters to pass to linker. Thus the error messages printed by the linker refers to one on these attempts. The Mkefiles and stuff are generated correctly anyway.
thanks for telling us about these types of messages. I will be testing builds on 64 bit too, and this type of info is *extremely* helpful. Please keep telling us when you hit these glitches!
Is't a real pleasure and honor to work with coreboot community. I find it very collaborative with respect to others community I'm used to work with.
Regards, llandre
DAVE Electronics System House - R&D Department web: http://www.dave.eu email: r&d2@dave-tech.it
On Tue, May 20, 2008 at 10:20:16AM +0200, llandre wrote:
Is't a real pleasure and honor to work with coreboot community. I find it very collaborative with respect to others community I'm used to work with.
Thank you very much! We're glad to have you, and all other contributors, onboard! :)
It is really exciting to see so many board makers have an interest in the project.
//Peter