On a powerpc64, system-clang crashes on audio/alsa-lib 's control.lo : "error in backend: A @@ version cannot be undefined"

Jan Beich jbeich at FreeBSD.org
Fri Oct 12 13:00:54 UTC 2018


Mark Millard <marklmi at 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");
  }


More information about the freebsd-toolchain mailing list