Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Oct 2018 15:00:49 +0200
From:      Jan Beich <jbeich@FreeBSD.org>
To:        Mark Millard <marklmi@yahoo.com>
Cc:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   Re: On a powerpc64, system-clang crashes on audio/alsa-lib 's control.lo : "error in backend: A @@ version cannot be undefined"
Message-ID:  <8t33-9v5q-wny@FreeBSD.org>
In-Reply-To: <1B7575F6-ED4D-42FE-BD51-B976F21B7CA6@yahoo.com> (Mark Millard's message of "Wed, 10 Oct 2018 21:40:17 -0700")
References:  <1B7575F6-ED4D-42FE-BD51-B976F21B7CA6@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Mark Millard <marklmi@yahoo.com> writes:

> The following is on a powerpc64 machine (old PowerMac G5 so-called
> "Quad Core") running a personal build of head -r339076 that was
> built via devel/powerpc64-xtoolchain-gcc and such (no gcc 4.2.1).
> The compiler for the port build is system-clang (so clang 6 as cc),
> not used for buildworld buildkernel. [I experiment with more modern
> compilers and toolchains for some powerpc family members.]
[...]
> /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H
> -I. -I../../include -I../../include -I/usr/ports/audio/alsa-lib/files
> -O2 -pipe -g -fno-strict-aliasing -MT control.lo -MD -MP -MF
> .deps/control.Tpo -c -o control.lo control.c
[...]
> fatal error: error in backend: A @@ version cannot be undefined
> cc: error: clang frontend command failed with exit code 70 (use -v to see invocation)
> FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)
> Target: powerpc64-unknown-freebsd12.0
> Thread model: posix
> InstalledDir: /usr/bin

Looks easy to reproduce on amd64 via -target e.g.,

  $ cd /usr/ports/audio/alsa-lib
  $ make clean configure
  $ cd $(make -V WRKSRC)/src/control
  $ ln -s ${SYSDIR:-/usr/src/sys}/powerpc/include /tmp/machine
  $ make control.lo CC='cc -target powerpc64-unknown-freebsd12.0 -isystem /tmp'
  [...]
  fatal error: error in backend: A @@ version cannot be undefined
  cc: error: clang frontend command failed with exit code 70 (use -v to see invocation)
  FreeBSD clang version 7.0.0 (tags/RELEASE_700/final 342383) (based on LLVM 7.0.0)

which points to the following conditional

  #ifdef __powerpc64__
  # define symbol_version(real, name, version) 			\
          __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@" #version);	\
          __asm__ (".symver ." ASM_NAME(#real) ",." ASM_NAME(#name) "@" #version)
  # define default_symbol_version(real, name, version) 		\
          __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@@" #version);	\
          __asm__ (".symver ." ASM_NAME(#real) ",." ASM_NAME(#name) "@@" #version)
  #else
  # define symbol_version(real, name, version) \
          __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@" #version)
  # define default_symbol_version(real, name, version) \
          __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@@" #version)
  #endif

and can be further reduced to

  int main()
  {
    __asm__ (".symver __foo,foo@@FOO");
    __asm__ (".symver .__foo,.foo@@FOO");
  }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8t33-9v5q-wny>