From owner-freebsd-ppc@freebsd.org Fri Oct 12 13:00:53 2018 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D674510BBDDD; Fri, 12 Oct 2018 13:00:53 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8695A81622; Fri, 12 Oct 2018 13:00:53 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 5DD52A606; Fri, 12 Oct 2018 13:00:53 +0000 (UTC) From: Jan Beich To: Mark Millard Cc: FreeBSD Toolchain , FreeBSD PowerPC ML Subject: Re: On a powerpc64, system-clang crashes on audio/alsa-lib 's control.lo : "error in backend: A @@ version cannot be undefined" References: <1B7575F6-ED4D-42FE-BD51-B976F21B7CA6@yahoo.com> Date: Fri, 12 Oct 2018 15:00:49 +0200 In-Reply-To: <1B7575F6-ED4D-42FE-BD51-B976F21B7CA6@yahoo.com> (Mark Millard's message of "Wed, 10 Oct 2018 21:40:17 -0700") Message-ID: <8t33-9v5q-wny@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2018 13:00:54 -0000 Mark Millard 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"); }