Opened 8 months ago

Closed 8 months ago

#69518 closed defect (fixed)

pkgconfig @0.29.2: error: incompatible integer to pointer conversion

Reported by: rbeyer (Ross Beyer) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.9.1
Keywords: sonoma Cc:
Port: pkgconfig

Description

I have a new-out-of-the-box Sonoma 14.3.1 M3 Max system that I installed MacPorts on. The first thing I tried to install was git. First I ran into a libiconv problem (successfully fixed, thank you), but now pkgconfig is erroring on install.

I've never had this trouble installing what I consider to be basic stuff onto a new Mac with MacPorts. Here is the relevant section from the full log (which is attached):

:info:build libtool: compile:  /usr/bin/clang -DHAVE_CONFIG_H -I. -I.. -I.. -I../glib -I..
/glib -I.. -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DGLIB_COMPILATION -DPCRE_STATI
C -I/opt/macports/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -
D_REENTRANT -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-
prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -
Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -pipe -Os -isysroot/L
ibrary/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64 -MT libglib_2_0_la-grel.lo
 -MD -MP -MF .deps/libglib_2_0_la-grel.Tpo -c deprecated/grel.c -o libglib_2_0_la-grel.o
:info:build gatomic.c:392:10: error: incompatible integer to pointer conversion passing 'g
ssize' (aka 'long') to parameter of type 'gpointer' (aka 'void *') [-Wint-conversion]
:info:build   return g_atomic_pointer_add ((volatile gpointer *) atomic, val);
:info:build          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build ./gatomic.h:170:46: note: expanded from macro 'g_atomic_pointer_add'
:info:build     (gssize) __sync_fetch_and_add ((atomic), (val));                         \
:info:build                                              ^~~~~
:info:build gatomic.c:416:10: error: incompatible integer to pointer conversion passing 'g
size' (aka 'unsigned long') to parameter of type 'gpointer' (aka 'void *') [-Wint-conversi
on]
:info:build   return g_atomic_pointer_and ((volatile gpointer *) atomic, val);
:info:build          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build ./gatomic.h:177:45: note: expanded from macro 'g_atomic_pointer_and'
:info:build     (gsize) __sync_fetch_and_and ((atomic), (val));                          \
:info:build                                             ^~~~~
:info:build gatomic.c:440:10: error: incompatible integer to pointer conversion passing 'g
size' (aka 'unsigned long') to parameter of type 'gpointer' (aka 'void *') [-Wint-conversi
on]
:info:build   return g_atomic_pointer_or ((volatile gpointer *) atomic, val);
:info:build          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build ./gatomic.h:184:44: note: expanded from macro 'g_atomic_pointer_or'
:info:build     (gsize) __sync_fetch_and_or ((atomic), (val));                           \
:info:build                                            ^~~~~
:info:build gatomic.c:464:10: error: incompatible integer to pointer conversion passing 'g
size' (aka 'unsigned long') to parameter of type 'gpointer' (aka 'void *') [-Wint-conversi
on]
:info:build   return g_atomic_pointer_xor ((volatile gpointer *) atomic, val);
:info:build          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build ./gatomic.h:191:45: note: expanded from macro 'g_atomic_pointer_xor'
:info:build     (gsize) __sync_fetch_and_xor ((atomic), (val));                          \
:info:build                                             ^~~~~
:info:build 4 errors generated.
:info:build make[6]: *** [libglib_2_0_la-gatomic.lo] Error 1

Is it me? Do I have something misconfigured on this new system?

Attachments (1)

pkgconfig_main.log (94.2 KB) - added by rbeyer (Ross Beyer) 8 months ago.
main.log file produced after a "port clean --all pkgconfig" and then a "port install pkgconfig'.

Download all attachments as: .zip

Change History (8)

Changed 8 months ago by rbeyer (Ross Beyer)

Attachment: pkgconfig_main.log added

main.log file produced after a "port clean --all pkgconfig" and then a "port install pkgconfig'.

comment:1 Changed 8 months ago by kencu (Ken)

This looks like a new clang default error:

https://reviews.llvm.org/D129881

I don't see the elegant fix in glib yet. People appear to be just turning the new error back off again:

https://github.com/bazelbuild/rules_foreign_cc/pull/1069/commits/5fe5c479189efafe7e1fc8a4403df4a0873e72a5

There is a premade binary of pkgconfig sitting on the packages server, so you'll only see this if you try to build from source of course. So you might just install that premade binary until someone fixes this.

comment:2 Changed 8 months ago by kencu (Ken)

Owner: set to ryandesign
Status: newassigned

comment:3 Changed 8 months ago by kencu (Ken)

No surprise, turning the error off fixes the build on newer clangs. You can add this to the Portfile to get this built if you need to:

configure.cflags-append -Wno-int-conversion

Ryan will look at this and see what he wants to do. Perhaps there is an official fix in whatever source repo pkgconfig comes from that he will want to use instead. Certainly if he does want to turn the error off, it'll have to be restricted to the compilers that understand that flag.

comment:4 in reply to:  description Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to rbeyer:

I've never had this trouble installing what I consider to be basic stuff onto a new Mac with MacPorts.

Is it me? Do I have something misconfigured on this new system?

You're using Xcode 15.3 and its command line tools, which includes the latest versions of clang. When using the latest compilers, it's not unusual to experience breakage due to programming practices that used to result in warnings now resulting in errors. Until I have time to look at this, probably tomorrow, one workaround to this and other recently-discovered problems in ports is to downgrade Xcode and its command line tools to 15.2.

Replying to kencu:

There is a premade binary of pkgconfig sitting on the packages server, so you'll only see this if you try to build from source of course. So you might just install that premade binary until someone fixes this.

This user uses a non-default prefix so cannot use our binaries.

comment:5 Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: sonoma added
Status: assignedaccepted
Summary: pkgconfig @ 0.29.2: won't install on M3 mac due to "incompatible integer to pointer conversion"pkgconfig @0.29.2: error: incompatible integer to pointer conversion

comment:6 Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)

The upstream glib patch fails to apply to the version of glib included in pkg-config so I'll go with downgrading the error to a warning (rather than disabling the warning).

comment:7 Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In a3f730ef13c476e971d094ecf30a5a5a0e330e0b/macports-ports (master):

pkgconfig: Downgrade int-conversion error to warning

Closes: #69518

Note: See TracTickets for help on using tickets.