#62969 closed defect (fixed)
libsndfile @1.0.31_1+universal: compile fails, preprocessor macros about architecture missing
Reported by: | JDLH (Jim DeLaHunt) | Owned by: | kencu (Ken) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.0 |
Keywords: | Cc: | ||
Port: | libsndfile |
Description
When upgrading outdated port libsndfile @1.0.31_0+universal to libsndfile @1.0.31_1+universal, build fails with a few compiler errors. All seem to be a matter of architecture-related preprocessor macros not being defined.
Build log attached. The interesting messages appear to be:
… [elided] … :info:build libtool: compile: /usr/bin/clang -DHAVE_CONFIG_H -I. -I./src -I./src -I./include -I./include -I/opt/local/include -D_FORTIFY_SOURCE=2 -I/opt/local/include/opus -pipe -Os -arch x86_64 -arch i386 -Wall -Wextra -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wwrite-strings -Wundef -Wuninitialized -Winit-self -Wno-format-truncation -Wvla -Wbad-function-cast -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Waggregate-return -c src/ulaw.c -o src/libcommon_la-ulaw.o >/dev/null 2>&1 :info:build In file included from src/pcm.c:24: :info:build ./src/sfendian.h:125:27: error: invalid token at start of a preprocessor expression :info:build #if (CPU_IS_LITTLE_ENDIAN == 1) :info:build ^ :info:build ./src/sfendian.h:127:26: error: invalid token at start of a preprocessor expression :info:build #elif (CPU_IS_BIG_ENDIAN == 1) :info:build ^ :info:build ./src/sfendian.h:130:3: error: "Target CPU endian-ness unknown. May need to hand edit src/sfconfig.h" :info:build #error "Target CPU endian-ness unknown. May need to hand edit src/sfconfig.h" … [elided] … :info:build src/pcm.c:137:23: error: expected expression :info:build if (CPU_IS_BIG_ENDIAN) :info:build ^ :info:build src/pcm.c:315:12: warning: implicit declaration of function 'LE2H_32' is invalid in C99 [-Wimplicit-function-declaration] :info:build { value = LE2H_32 (src [count]) ; :info:build ^ :info:build src/pcm.c:315:12: warning: this function declaration is not a prototype [-Wstrict-prototypes] :info:build src/pcm.c:325:12: warning: implicit declaration of function 'BE2H_32' is invalid in C99 [-Wimplicit-function-declaration] :info:build { value = BE2H_32 (src [count]) ; :info:build ^ :info:build src/pcm.c:325:12: warning: this function declaration is not a prototype [-Wstrict-prototypes] … [elided] … :info:build 17 warnings and 15 errors generated. :info:build make[2]: *** [src/libcommon_la-pcm.lo] Error 1 … [elided] …
Observed on macOS 10.13.6 High Sierra.
My current installed version is @1.0.31_0+universal, and I did a port upgrade outdated
a few days ago. Thus I suspect that this problem was triggered by the change to @1.0.31_1 in commit fcf6712, which addressed #62896 .
Attachments (1)
Change History (13)
Changed 3 years ago by JDLH (Jim DeLaHunt)
comment:1 Changed 3 years ago by JDLH (Jim DeLaHunt)
Summary: | libsndfile @1.0.31_1+universal: compie fails, preprocessor macros about architecture missing → libsndfile @1.0.31_1+universal: compile fails, preprocessor macros about architecture missing |
---|
Fix typo "compie". Apparenty I can't actuay type the etter between k and m. What a oser. (smie :-) )
comment:2 Changed 3 years ago by RiotNrrrd
I'm running into this exact same problem on macOS Sierra 10.12.6:
Mac-mini:/ root# uname -a Darwin Mac-mini.local 16.7.0 Darwin Kernel Version 16.7.0: Sun Jun 2 20:26:31 PDT 2019; root:xnu-3789.73.50~1/RELEASE_X86_64 x86_64 Mac-mini:/ root# port installed libsndfile The following ports are currently installed: libsndfile @1.0.31_0+universal (active) Mac-mini:/ root# port upgrade libsndfile ---> Computing dependencies for libsndfile ---> Fetching archive for libsndfile ---> Attempting to fetch libsndfile-1.0.31_1+universal.darwin_16.i386-x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/libsndfile ---> Attempting to fetch libsndfile-1.0.31_1+universal.darwin_16.i386-x86_64.tbz2 from https://kmq.jp.packages.macports.org/libsndfile ---> Attempting to fetch libsndfile-1.0.31_1+universal.darwin_16.i386-x86_64.tbz2 from https://mse.uk.packages.macports.org/libsndfile ---> Building libsndfile Error: Failed to build libsndfile: command execution failed Error: See /opt/local/var/macports/logs/_private_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_libsndfile/libsndfile/main.log for details. Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
comment:3 Changed 3 years ago by jmroot (Joshua Root)
Looks like it's detecting the CPU type (singular) at configure time. That needs to be changed so it detects at compile time, as it is different for each universal slice.
comment:4 Changed 3 years ago by RiotNrrrd
@jmroot Any idea why it works fine on macOS Mojave, then?
comment:6 Changed 3 years ago by kencu (Ken)
Yeah, that works just fine:
PortSystem 1.0 PortGroup github 1.0 + PortGroup muniversal 1.0 github.setup libsndfile libsndfile 1.0.31 revision 1
comment:7 Changed 3 years ago by kencu (Ken)
It works fine as-is on Mojave because -- get ready for it -- Mojave does not support any universal builds ;>
comment:8 Changed 3 years ago by kencu (Ken)
Owner: | set to kencu |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:10 Changed 3 years ago by JDLH (Jim DeLaHunt)
Thank you for the prompt response!
The audio/libsndfile/Portfile
in commit d10dce3c worked for me, on macOS 10.13.6 High Sierra. It configured, built, and installed with no complaints. It replaced libsndfile @1.0.31_0+universal.
It looks to me like the revision remains at 1. Is that OK? It worked for me, but I did not already have libsndfile @1.0.31_1 installed. I am a newbie about portfiles, and I don't know when the revision must be incremented and when it doesn't need to be.
comment:11 Changed 3 years ago by kencu (Ken)
Yes, all is well with the revision. Fire away however if anything doesn't work to your satisfaction.
comment:12 Changed 3 years ago by RiotNrrrd
Fixed for me on Sierra 10.12.6 as well. Thanks kencu (Ken)!
main.log from upgrading libsndfile @1.0.31_0+universal to @1.0.31_1 on macOS 10.13.6 High Sierra.