Nick: PaulePanter
E-mail: none
Board: unknown
Contents: 
$ clang -fuse-ld=lld -pipe -g -nostdinc -std=gnu11 -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wno-trigraphs -Wimplicit-fallthrough -Wshadow -Wdate-time -Wtype-limits -Wvla -Wold-style-definition -Wdangling-else -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -fno-pie -Werror -Os -target i386-elf -m32 -Wl,-b,elf32-i386 -Wl,-melf_i386 -Qunused-arguments -m32 -Wno-unused-variable -Wno-unused-function -Wno-tautological-compare -Wno-shift-overflow -Wno-address-of-packed-member -Wno-initializer-overrides -fbracket-depth=2048 -march=i686 -mno-mmx -Wl,--gc-sections,--nmagic,-nostdlib,-static -Wl,--emit-relocs  -z defs -Bsymbolic  -T build/rmodules_x86_32/lib/rmodule.ld -Wl,--defsym=__heap_size=0 -o build/smm/smm.elf -Wl,--whole-archive,--start-group build/smm/smm.o -Wl,--end-group
ld.lld: error: unknown --format value: elf32-i386 (supported formats: elf, default, binary)
collect2: error: ld returned 1 exit status
clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)

Removal of `-Wl,-b,elf32-i386` results in:

```
$ clang -fuse-ld=lld -pipe -g -nostdinc -std=gnu11 -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wno-trigraphs -Wimplicit-fallthrough -Wshadow -Wdate-time -Wtype-limits -Wvla -Wold-style-definition -Wdangling-else -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -fno-pie -Werror -Os -target i386-elf -m32 -Wl,-melf_i386 -Qunused-arguments -m32 -Wno-unused-variable -Wno-unused-function -Wno-tautological-compare -Wno-shift-overflow -Wno-address-of-packed-member -Wno-initializer-overrides -fbracket-depth=2048 -march=i686 -mno-mmx -Wl,--gc-sections,--nmagic,-nostdlib,-static -Wl,--emit-relocs  -z defs -Bsymbolic  -T build/rmodules_x86_32/lib/rmodule.ld -Wl,--defsym=__heap_size=0 -o build/smm/smm.elf -Wl,--whole-archive,--start-group build/smm/smm.o -Wl,--end-group
ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smm_module_handler.c:131 (/dev/shm/coreboot/src/cpu/x86/smm/smm_module_handler.c:131)
>>>               build/smm/smm.o:(smm_handler_start)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smm_module_handler.c:32 (/dev/shm/coreboot/src/cpu/x86/smm/smm_module_handler.c:32)
>>>               build/smm/smm.o:(smm_handler_start)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smm_module_handler.c:81 (/dev/shm/coreboot/src/cpu/x86/smm/smm_module_handler.c:81)
>>>               build/smm/smm.o:(smm_handler_start)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smm_module_handler.c:159 (/dev/shm/coreboot/src/cpu/x86/smm/smm_module_handler.c:159)
>>>               build/smm/smm.o:(smm_handler_start)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smm_module_handler.c:163 (/dev/shm/coreboot/src/cpu/x86/smm/smm_module_handler.c:163)
>>>               build/smm/smm.o:(smm_handler_start)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smm_module_handler.c:89 (/dev/shm/coreboot/src/cpu/x86/smm/smm_module_handler.c:89)
>>>               build/smm/smm.o:(smm_handler_start)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smm_module_handler.c:46 (/dev/shm/coreboot/src/cpu/x86/smm/smm_module_handler.c:46)
>>>               build/smm/smm.o:(smm_handler_start)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smm_module_handler.c:142 (/dev/shm/coreboot/src/cpu/x86/smm/smm_module_handler.c:142)
>>>               build/smm/smm.o:(smm_handler_start)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smihandler.c:467 (/dev/shm/coreboot/src/southbridge/intel/common/smihandler.c:467)
>>>               build/smm/smm.o:(southbridge_smi_handler)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by acpi.h:0 (src/include/acpi/acpi.h:0)
>>>               build/smm/smm.o:(southbridge_smi_sleep)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smihandler.c:287 (/dev/shm/coreboot/src/southbridge/intel/common/smihandler.c:287)
>>>               build/smm/smm.o:(southbridge_smi_apmc)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smihandler.c:293 (/dev/shm/coreboot/src/southbridge/intel/common/smihandler.c:293)
>>>               build/smm/smm.o:(southbridge_smi_apmc)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smihandler.c
>>>               build/smm/smm.o:(.rodata.southbridge_smi_sleep+0x0)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smihandler.c
>>>               build/smm/smm.o:(.rodata.southbridge_smi_sleep+0x4)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smihandler.c
>>>               build/smm/smm.o:(.rodata.southbridge_smi_sleep+0x8)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smihandler.c
>>>               build/smm/smm.o:(.rodata.southbridge_smi_sleep+0xC)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smihandler.c
>>>               build/smm/smm.o:(.rodata.southbridge_smi_sleep+0x10)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smihandler.c
>>>               build/smm/smm.o:(.rodata.southbridge_smi_sleep+0x14)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smihandler.c
>>>               build/smm/smm.o:(.rodata.southbridge_smi_sleep+0x18)

ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in build/smm/smm.o
>>> referenced by smihandler.c
>>>               build/smm/smm.o:(.rodata.southbridge_smi_sleep+0x1C)

ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
collect2: error: ld returned 1 exit status
clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)
```