Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#61354 closed defect (fixed)

jq does not build with Xcode 12.0.1 on macOS 10.15 (darwin/19.6.0)

Reported by: tgyurci (Teubel György) Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: chrstphrchvz (Christopher Chavez), danchr (Dan Villiom Podlaski Christiansen)
Port: jq

Description

After upgrading to latest Xcode jq failed to build:

src/builtin.c:194:31: error: implicit declaration of function 'lgamma_r' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  jv ret = JV_ARRAY(jv_number(lgamma_r(jv_number_value(input), &sign)));

Applying the already present patch from patch-src-builtin.c eliminates the error and jq complies successfully.

System info:

DEBUG: macOS 10.15 (darwin/19.6.0) arch i386                                                                                                          
DEBUG: MacPorts 2.6.3                                                                                                                                 
DEBUG: Xcode 12.0.1                                                                                                                                   
DEBUG: SDK 10.15
DEBUG: MACOSX_DEPLOYMENT_TARGET: 10.15

Change History (5)

comment:1 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

comment:2 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:3 Changed 4 years ago by mf2k (Frank Schima)

Cc: raimue removed
Owner: set to raimue
Status: newassigned

comment:4 Changed 4 years ago by danchr (Dan Villiom Podlaski Christiansen)

Resolution: fixed
Status: assignedclosed

In 05ec0097df09635392ab134d8fa7ea7304160643/macports-ports (master):

jq: fix build with Xcode 12

The jq configure system checks whether lgamma_r() is defined in
libm, but not whether it is actually declared. On macOS, that is not
the case unless _REENTRANT was defined prior to including math.h.
Xcode 12 changed the defaults, so that using an undefined symbol gives
a hard error, breaking the build.

I had only run into this when building on an unreleased OS, but the
error is actually specific to Xcode 12. This adjusts the builtin patch
to address root cause, rather than just bypassing it, and applies the
patch universally.

Fixes: #61354
Closes: https://github.com/macports/macports-ports/pull/8870

comment:5 Changed 4 years ago by danchr (Dan Villiom Podlaski Christiansen)

Cc: danchr added
Note: See TracTickets for help on using tickets.