Re: Compiling BETA2 with clang fails

From: Volodymyr Kostyrko <c.kworr_at_gmail.com>
Date: Fri, 09 Sep 2011 06:45:16 +0300
06.09.2011 17:44, Olivier Smedts wrote:
>> You mean like fully rebuilding system with gcc and -march=athlon-xp and then
>> try again?
>
> Like cleaning /usr/obj/ and then buildworld with clang but with
> "-march=athlon-xp" instead of "-march=native".
> As the problem does not seem to be in your current world but rather in
> the bootstrap clang compiled with -march=native, you should not have
> to {build,install}world with gcc first.

I cleaned /usr/obj and made a build with -march=athlon-xp. Same errors.

I've also tried to investigate further.

This happens when clang runs linker to link a binary. It runs something 
like:

"/usr/obj/usr/src/tmp/usr/bin/ld" --eh-frame-hdr -dynamic-linker 
/libexec/ld-elf.so.1 -m elf_i386_fbsd -o atrun 
/usr/obj/usr/src/tmp/usr/lib/crt1.o /usr/obj/usr/src/tmp/usr/lib/crti.o 
/usr/obj/usr/src/tmp/usr/lib/crtbegin.o -L/usr/obj/usr/src/tmp/usr/lib 
atrun.o gloadavg.o -lpam -lutil -lgcc --as-needed -lgcc_s --no-as-needed 
-lc -lgcc --as-needed -lgcc_s --no-as-needed 
/usr/obj/usr/src/tmp/usr/lib/crtend.o /usr/obj/usr/src/tmp/usr/lib/crtn.o

Showstopper here is -L. If I add -L/usr/lib to this command it completes 
successfully.

# nm -D /usr/obj/usr/src/tmp/usr/lib/libc.so
00000000 A FBSD_1.0
00000000 A FBSD_1.1
00000000 A FBSD_1.2
00000000 A FBSDprivate_1.0
          w _Jv_RegisterClasses
          U __progname
          w __pthread_cxa_finalize
00030624 T __semctl
0000dbe0 T __stack_chk_fail_local
00012880 T acl_add_perm
000128b0 T acl_delete_perm
00012850 T acl_get_perm_np
          U environ
00029610 T fts_children
000286b0 T fts_close
00029770 T fts_get_clientptr
00029780 T fts_get_stream
00027f70 T fts_open
000287e0 T fts_read
000295d0 T fts_set
00029790 T fts_set_clientptr
000305c4 T msgctl
0001e910 T sem_close
0001e6a0 T sem_destroy
0001edb0 T sem_getvalue
0001e5c0 T sem_init
0001e730 T sem_open
0001ed20 T sem_post
0001ea00 T sem_timedwait
0001ec90 T sem_trywait
0001e9e0 T sem_unlink
0001ec60 T sem_wait
00021a30 T semctl
00030524 T shmctl
0001fff0 T ttyslot

That's the problem - libraries miss most symbols.

That's all for now, I'll be back at this one tomorrow.

-- 
Sphinx of black quartz judge my vow.
Received on Fri Sep 09 2011 - 01:45:21 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:17 UTC