You are not logged in.

#1 2025-12-20 14:53:13

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,565

[Solved] Is repo clang build with objective-c ARC support ?

I'm trying to use libobjc2 to build gnustep-make & gnustep-base against that library with clang.

The libobjc2 version is supposed to be faster, better optimised and with more features then the one provided by gcc-objc / gcc-libs .

Unfortunately that lib can only be used when building with clang.
Trying to build gnustep-make against libobjc2 results in

checking for the flag to link libobjc... objc2
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for domains containing libraries libobjc.a, libobjc.so, libobjc.dll.a, libobjc-gnu.dylib, objc.lib... SYSTEM, NETWORK, LOCAL
checking for domains containing headers objc/objc.h... SYSTEM, NETWORK, LOCAL
checking for custom shared objc library domain... SYSTEM
checking whether objc has thread support... no
checking whether Objective-C++ is supported... yes
checking whether we should use ARC... no
configure: Building ARC code was requested, but the compiler
configure: doesn't support it.
configure: error: compiler doesn't support ARC

The PKGBUILD I'm using is the one used by repo gnustep-make with adjustments

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Vesa Kaihlavirta <vegai@iki.fi>
# Contributor: Sebastian Sareyko <public@nooms.de>

pkgname=gnustep-make
pkgver=2.9.3
pkgrel=0.1
pkgdesc='The GNUstep make package'
arch=('x86_64') # See FS#29546
url='https://www.gnustep.org/'
license=('GPL-3.0-or-later')
makedepends=('git' 'clang' 'libobjc2')
groups=('gnustep-core')
backup=('etc/GNUstep/GNUstep.conf')
source=("$pkgname::git+https://github.com/gnustep/tools-make#tag=make-${pkgver//./_}")
sha512sums=('102193e1eef30905be5e1b1de969a244b549a4a0545661155b094e5bb25ec614360fc2cff00bff791421db9814a65f747469d21c717cf936461cf57ae4ea3bcf')
b2sums=('a2d45b87b7a79c80dc4e0fc9aaccd024b1ac81b49c4116e965b0fc3bbbd1bb967cffe1e87b0d5cfb98a5448172932def27076c067b444bc191790bef75a8abba')

prepare() {
  cd "$pkgname"

  for i in GNUSTEP_SYSTEM_ADMIN_TOOLS GNUSTEP_NETWORK_ADMIN_TOOLS GNUSTEP_LOCAL_ADMIN_TOOLS; do
    sed -i "s|@$i@|/usr/bin|g" GNUstep{,-strict-v2}.conf.in filesystem.{sh,csh,make}.in
  done
}

build() {
  cd "$pkgname"

  export CC=clang
  export CXX=clang++
  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --sysconfdir=/etc/GNUstep \
    --enable-native-objc-exceptions \
    --with-objc-lib-flag=objc2 \
    --with-library-combo=ng-gnu-gnu \
    --with-runtime-abi=gnustep-2.2
  make
}

package() {
  cd "$pkgname"

  make DESTDIR="$pkgdir" install
}

Last edited by Lone_Wolf (2025-12-21 18:27:09)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#2 2025-12-21 07:07:38

ReDress
Member
From: Nairobi
Registered: 2024-11-30
Posts: 192

Re: [Solved] Is repo clang build with objective-c ARC support ?

Uhmmm... probably a lame response.

But I would make sure that ARC is actually needed first.

Offline

#3 2025-12-21 16:20:31

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,565

Re: [Solved] Is repo clang build with objective-c ARC support ?

configure: Building ARC code was requested, but the compiler
configure: doesn't support it.

So someting in the software requires it.
-f-no-objc-arc &  -f-objc-arc seems to be used to indicate code needs to be compiled with/without arc.
I can find nothing about enabling objc-arc in clang though.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#4 2025-12-21 17:29:13

swsnr
Member
Registered: 2024-01-21
Posts: 26

Re: [Solved] Is repo clang build with objective-c ARC support ?

Don't get all set on the on the idea that Clang doesn't support ARC.  ARC's been there since like twenty years, I doubt that it's even possible to disable ARC support in Clang at compile time.

Instead, try to understand what the message you're seeing really means, and then take a look at config.log to see how the corresponding check actually failed.

Last edited by swsnr (2025-12-21 18:22:34)

Offline

#5 2025-12-21 17:30:01

ReDress
Member
From: Nairobi
Registered: 2024-11-30
Posts: 192

Re: [Solved] Is repo clang build with objective-c ARC support ?

I don't really trust configure script.

And a lot of times it is looking for things it doesn't need.

Offline

#6 2025-12-21 18:26:17

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,565

Re: [Solved] Is repo clang build with objective-c ARC support ?

Checking config.log revealed it couldn't find objc2 .

replacing objc2 with -lobjc2 so the PKGBUILD now has 

--with-objc-lib-flag=-lobjc2 \

solved the build failure.

The issue had nothing to do with arc and the error message should have been "can't find user-specified library" or similar.


Thanks for the help, marking as [Solved}.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB