libX11 and clang: compile error

Oliver Pinter oliver.pntr at gmail.com
Sat May 26 18:48:44 UTC 2012


On 5/26/12, Mel Flynn <rflynn at acsalaska.net> wrote:
> On 26-5-2012 19:17, Oliver Pinter wrote:
>> I think src.conf is relevant, while it changes the system behavior, as
>> changed the default cc from gcc-4.2 to clang.
>
> Thinking it doesn't make it so. Run:
> grep _WITHOUT_SRCCONF /usr/share/mk/*.mk
>
> Then investigate.
> Setting CC in /etc/src.conf has *no effect on CC passed to the ports*.
> Really. It does not.
> The file that can do that is /etc/make.conf.
> Another way is setting CC in your environment variables, through
> /etc/login.conf, /etc/yourshellrc ~/.profile ~/.[cz]?shrc and what not.
>
> In order to debug your issue, you should provide the output of what make
> thinks CC and CPP are and backtrack where they are set.
> Start with:
> make -C /usr/ports/x11/libX11 -V CC -V CPP
> --
> Mel
>

After setting WITH_CLANG_IS_CC in src.conf the base system cc,cpp and
c++ has changed:

op at opn ~> cc --version
FreeBSD clang version 3.1 (branches/release_31 155985) 20120503
Target: x86_64-unknown-freebsd9.0
Thread model: posix
op at opn ~> cpp --version
FreeBSD clang version 3.1 (branches/release_31 155985) 20120503
Target: x86_64-unknown-freebsd9.0
Thread model: posix
op at opn ~> c++ --version
FreeBSD clang version 3.1 (branches/release_31 155985) 20120503
Target: x86_64-unknown-freebsd9.0
Thread model: posix

This is the new behavior after this patch:

commit 61fe77c5c9eb33f033bd89d869b05ce6dcd5fd5f
Author: dim <dim at ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Date:   Sat Mar 17 22:29:05 2012 +0000

    MFC 232322:
      Add a WITH_CLANG_IS_CC option for src.conf(5), disabled by default, that
      installs clang as /usr/bin/cc, /usr/bin/c++ and /usr/bin/cpp.

      Note this does *not* disable building and installing gcc, which will
      still be available as /usr/bin/gcc, /usr/bin/g++ and /usr/bin/gcpp.  If
      you want to disable gcc completely, you must use WITHOUT_GCC.

    MFC 232323:
      Regenerate src.conf(5) after r232322.
    MFC 232323:
      Regenerate src.conf(5) after r232322.

    MFC 232477:
      In r232322, I forgot one case where a check for MK_CLANG_IS_CC was
      needed, in sys/conf/kern.pre.mk.  Add it now.

    MFC 232522:
      Fix a thinko in r232322, where gcc (and its tools) are not built during
      the cross-tools stage, if CC=clang and WITH_CLANG_IS_CC is not set.

      This causes no 'cc' to be installed in the temporary cross-tools tree,
      making lint fall over later in the build, because it ignores ${CC} and
      attempts to run 'cc' anyway.

      To fix this, only skip building gcc during cross-tools, if WITHOUT_GCC
      is set, or if WITH_CLANG_IS_CC is set.

      Pointy hat to:    dim

    git-svn-id: svn://svn.freebsd.org/base/stable/9@233099 ccf9f872-aa2e-dd11-9f
-------------- next part --------------
Script started on Sat May 26 20:38:09 2012

op has logged on :0 from local.
root@opn libX11# make extract

===>  License MIT accepted by the user
===>  Extracting for libX11-1.4.4,1
=> SHA256 Checksum OK for xorg/lib/libX11-1.4.4.tar.bz2.
root@opn libX11# make 0-C /usr/local/ports/x

x11-clocks/   x11-fm/       x11-servers/  x11-toolkits/ x11/

x11-drivers/  x11-fonts/    x11-themes/   x11-wm/       

root@opn libX11# make -C /usr/ports/x11/li

libICE/              libXprintUtil/       libgnomekbd/

libSM/               libXrandr/           libgnomemm/

libX11/              libXrender/          libgnomemm26/

libXScrnSaver/       libXres/             libkonq/

libXTrap/            libXtrans/           liboldX/

libXau/              libXtst/             libsx/

libXcomposite/       libXv/               libsynaptics/

libXcursor/          libXvMC/             libxcb/

libXdamage/          libXxf86dga/         libxdg-basedir/

libXdmcp/            libXxf86misc/        libxfce4menu/

libXevie/            libXxf86vm/          libxfce4util/

libXext/             libdmx/              libxkbfile/

libXfixes/           libdnd/              libxkbui/

libXi/               libexo/              libxklavier/

libXinerama/         libfm/               linux-f10-xorg-libs/

libXp/               libgnome-java/       linux-f8-xorg-libs/

libXpm/              libgnome-reference/  linux-xorg-libs/

libXprintAppUtil/    libgnome/            listres/

root@opn libX11# make -C /usr/ports/x11/libX

libX11/           libXdmcp/         libXpm/           libXtst/

libXScrnSaver/    libXevie/         libXprintAppUtil/ libXv/

libXTrap/         libXext/          libXprintUtil/    libXvMC/

libXau/           libXfixes/        libXrandr/        libXxf86dga/

libXcomposite/    libXi/            libXrender/       libXxf86misc/

libXcursor/       libXinerama/      libXres/          libXxf86vm/

libXdamage/       libXp/            libXtrans/        

root@opn libX11# make -C /usr/ports/x11/libX11/ -V CC -CV CPP

cc
cpp
root@opn libX11# make -C /usr/ports/x11/libX11/ -V CC -V CPP[1 at f[1 at i[1 at r[1 at o[1 at o[1 at r[1 at e[1 at a[3 at ch [1 at i[1@ [1@([1@ [1@`` )

foreach? $i --versonion

foreach? end

FreeBSD clang version 3.1 (branches/release_31 155985) 20120503
Target: x86_64-unknown-freebsd9.0
Thread model: posix
FreeBSD clang version 3.1 (branches/release_31 155985) 20120503
Target: x86_64-unknown-freebsd9.0
Thread model: posix
root@opn libX11# ^Dexit

Script done on Sat May 26 20:39:33 2012


More information about the freebsd-ports mailing list