Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Nov 2011 13:03:35 +0100
From:      Olivier Smedts <olivier@gid0.org>
To:        Volodymyr Kostyrko <c.kworr@gmail.com>
Cc:        freebsd-current@freebsd.org, Dimitry Andric <dim@freebsd.org>
Subject:   Re: Compiling BETA2 with clang fails
Message-ID:  <CABzXLYNf5v4WUF-ZR3XPLCVz=OMKKA7N9W%2BKp1ubEjjg2ykxJg@mail.gmail.com>
In-Reply-To: <4E644993.4090703@gmail.com>
References:  <j3u29f$bv8$1@dough.gmane.org> <4E62915E.1010405@FreeBSD.org> <4E6294E0.5010104@gmail.com> <4E6298DE.5090007@FreeBSD.org> <4E644993.4090703@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2011/9/5 Volodymyr Kostyrko <c.kworr@gmail.com>:
>
> 0k, here you go. Just as you say - no -fPIC, no ccache, no anything.
>
> =3D=3D=3D> libexec/atrun (all)
> clang -O2 -pipe -march=3Dnative -DATJOB_DIR=3D\"/var/at/jobs/\"
> -DLFILE=3D\"/var/at/jobs/.lockfile\" =A0-DLOADAVG_MX=3D1.5
> -DATSPOOL_DIR=3D\"/var/at/spool\" =A0-DVERSION=3D\"2.9\" -DDAEMON_UID=3D1
> -DDAEMON_GID=3D1 =A0-DDEFAULT_BATCH_QUEUE=3D\'E\' =A0-DDEFAULT_AT_QUEUE=
=3D\'c\'
> -DPERM_PATH=3D\"/var/at/\" -I/usr/src/libexec/atrun/../../usr.bin/at
> -I/usr/src/libexec/atrun -DLOGIN_CAP -DPAM -std=3Dgnu99 -fstack-protector
> -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-si=
gn
> -c /usr/src/libexec/atrun/atrun.c
> clang -O2 -pipe -march=3Dnative -DATJOB_DIR=3D\"/var/at/jobs/\"
> -DLFILE=3D\"/var/at/jobs/.lockfile\" =A0-DLOADAVG_MX=3D1.5
> -DATSPOOL_DIR=3D\"/var/at/spool\" =A0-DVERSION=3D\"2.9\" -DDAEMON_UID=3D1
> -DDAEMON_GID=3D1 =A0-DDEFAULT_BATCH_QUEUE=3D\'E\' =A0-DDEFAULT_AT_QUEUE=
=3D\'c\'
> -DPERM_PATH=3D\"/var/at/\" -I/usr/src/libexec/atrun/../../usr.bin/at
> -I/usr/src/libexec/atrun -DLOGIN_CAP -DPAM -std=3Dgnu99 -fstack-protector
> -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-si=
gn
> -c /usr/src/libexec/atrun/gloadavg.c
> clang -O2 -pipe -march=3Dnative -DATJOB_DIR=3D\"/var/at/jobs/\"
> -DLFILE=3D\"/var/at/jobs/.lockfile\" =A0-DLOADAVG_MX=3D1.5
> -DATSPOOL_DIR=3D\"/var/at/spool\" =A0-DVERSION=3D\"2.9\" -DDAEMON_UID=3D1
> -DDAEMON_GID=3D1 =A0-DDEFAULT_BATCH_QUEUE=3D\'E\' =A0-DDEFAULT_AT_QUEUE=
=3D\'c\'
> -DPERM_PATH=3D\"/var/at/\" -I/usr/src/libexec/atrun/../../usr.bin/at
> -I/usr/src/libexec/atrun -DLOGIN_CAP -DPAM -std=3Dgnu99 -fstack-protector
> -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-si=
gn
> =A0-o atrun atrun.o gloadavg.o -lpam -lutil
> clang: warning: argument unused during compilation: '-std=3Dgnu99'
> /usr/obj/usr/src/tmp/usr/lib/crt1.o: In function `_start1':
> /usr/src/lib/csu/i386-elf/crt1_c.c:(.text+0x7d): undefined reference to
> `atexit'
> /usr/src/lib/csu/i386-elf/crt1_c.c:(.text+0x84): undefined reference to
> `_init_tls'
> /usr/src/lib/csu/i386-elf/crt1_c.c:(.text+0x90): undefined reference to
> `atexit'
> /usr/src/lib/csu/i386-elf/crt1_c.c:(.text+0xad): undefined reference to
> `exit'
> atrun.o: In function `perr':
> /usr/src/libexec/atrun/atrun.c:(.text+0x12): undefined reference to `strl=
en'
> /usr/src/libexec/atrun/atrun.c:(.text+0x45): undefined reference to `vwar=
n'
> /usr/src/libexec/atrun/atrun.c:(.text+0x6d): undefined reference to
> `snprintf'
> /usr/src/libexec/atrun/atrun.c:(.text+0x8a): undefined reference to
> `vsyslog'
> /usr/src/libexec/atrun/atrun.c:(.text+0x9c): undefined reference to `exit=
'
> atrun.o: In function `perrx':
> /usr/src/libexec/atrun/atrun.c:(.text+0xd3): undefined reference to `vwar=
nx'
> /usr/src/libexec/atrun/atrun.c:(.text+0xdf): undefined reference to `exit=
'
> /usr/src/libexec/atrun/atrun.c:(.text+0xf3): undefined reference to
> `vsyslog'
> /usr/src/libexec/atrun/atrun.c:(.text+0xff): undefined reference to `exit=
'
> atrun.o: In function `main':
> /usr/src/libexec/atrun/atrun.c:(.text+0x160): undefined reference to
> `geteuid'
> /usr/src/libexec/atrun/atrun.c:(.text+0x174): undefined reference to
> `getegid'
> /usr/src/libexec/atrun/atrun.c:(.text+0x186): undefined reference to
> `setegid'
> /usr/src/libexec/atrun/atrun.c:(.text+0x193): undefined reference to
> `seteuid'
[...]
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> *** Error code 1
>
> Stop in /usr/src/libexec/atrun.
> *** Error code 1
>
> Stop in /usr/src/libexec.
> *** Error code 1
>
> Stop in /usr/src.
> *** Error code 1
>
> Stop in /usr/src.
> *** Error code 1
>
> Stop in /usr/src.

Replying to an old thread, but FYI this problem which has been bugging
me since months has gone away since the lastest clang
branches/release_30 import, and it has been MFC'ed to stable/9. I can
now buildworld with -march=3Dcorei7 instead of -march=3Dcore2 :) (the same
should apply for -march=3Dnative)

Cheers

--=20
Olivier Smedts=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 _
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 ASCII ribbon campaign ( )
e-mail: olivier@gid0.org=A0 =A0 =A0 =A0 - against HTML email & vCards=A0 X
www: http://www.gid0.org=A0 =A0 - against proprietary attachments / \

=A0 "Il y a seulement 10 sortes de gens dans le monde :
=A0 ceux qui comprennent le binaire,
=A0 et ceux qui ne le comprennent pas."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CABzXLYNf5v4WUF-ZR3XPLCVz=OMKKA7N9W%2BKp1ubEjjg2ykxJg>