NetBSD Problem Report #54380

From  Tue Jul 16 12:44:19 2019
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id 8DD6B7A170
	for <>; Tue, 16 Jul 2019 12:44:19 +0000 (UTC)
Message-Id: <>
Date: Tue, 16 Jul 2019 12:44:18 +0000 (UTC)
Subject: devel/apr has unresolved references on NetBSD/macppc
X-Send-Pr-Version: www-1.0

>Number:         54380
>Category:       pkg
>Synopsis:       devel/apr has unresolved references on NetBSD/macppc
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 16 12:45:00 +0000 2019
>Originator:     Valery Ushakov
>Release:        pkgsrc-2019Q2
NetBSD pony 8.1_STABLE NetBSD 8.1_STABLE (GENERIC) #0: Sat Jun 15 07:30:17 MSK 2019  uwe@sampo:/home/uwe/work/netbsd/build8/obj/macppc/sys/arch/macppc/compile/GENERIC macppc
devel/apr was updated to 1.7.0 in pkgsrc-2019Q2

Building www/apache24 (that depends on devel/apr) on NetBSD/macppc fails with:

/bin/sh /export/netbsd/cvs/pkgsrc-quarterly/www/apache24/work.powerpc/httpd-2.4.39/build/libtool --silent --mode=link gcc  -pthread  -pipe -O2 -D_FORTIFY_SOURCE=2 -I/usr/pkg/include/apr-1 -I/usr/pkg/include -I/usr/include -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -o htpasswd  htpasswd.lo passwd_common.lo /usr/pkg/lib/ -lexpat /usr/pkg/lib/ -lrt -lcrypt -lpthread -lcrypt
/export/netbsd/cvs/pkgsrc-quarterly/www/apache24/work.powerpc/.buildlink/lib/ undefined reference to `__sync_fetch_and_add_8'
/export/netbsd/cvs/pkgsrc-quarterly/www/apache24/work.powerpc/.buildlink/lib/ undefined reference to `__sync_val_compare_and_swap_8'
/export/netbsd/cvs/pkgsrc-quarterly/www/apache24/work.powerpc/.buildlink/lib/ undefined reference to `__sync_lock_test_and_set_8'
/export/netbsd/cvs/pkgsrc-quarterly/www/apache24/work.powerpc/.buildlink/lib/ undefined reference to `__sync_fetch_and_sub_8'
/export/netbsd/cvs/pkgsrc-quarterly/www/apache24/work.powerpc/.buildlink/lib/ undefined reference to `__sync_sub_and_fetch_8'
*** Error code 1

apr tries to detect if the compiler HAVE_ATOMIC_BUILTINS by doing a
configure test with an unsigned long test variable and it succeeds b/c
ppc has 4-byte atomics.  Then it uses that condition to cover all of
its atomic functions, including 8-byte, which are not implemented on
ppc.  So gcc emits calls to external functions for them and those are

Perhaps apr should do the configure test with a known 8 byte type

I'd expect this to be the case for many other 32-bit platforms.

Specifically for ppc I was able to work around this by building with
ap_cv_atomic_builtins=no in the environment to force its hand and with
an additional change to include/arch/unix/apr_arch_atomic.h.  That
header tests for ppc by checking __PPC__ and __ppc__ which are not
defined, but doesn't check __powerpc__ which is.

Build www/apache24 on NetBSD/macppc

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.