Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#65858 closed defect (duplicate)

jasper @3.0.6 does not build on PPC Leopard, Mac OS X 10.5.8, because "conflicting types for 'max_align_t' typedef long double max_align_t;"

Reported by: ballapete (Peter "Pete" Dyballa) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: leopard ppc Cc: jmr@…
Port: jasper

Description

make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_jasper/jasper/work/build'
[  1%] Building C object src/libjasper/CMakeFiles/libjasper.dir/base/jas_cm.c.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_jasper/jasper/work/build/src/libjasper && /opt/local/bin/gcc-mp-7 -DGL_SILENCE_DEPRECATION -DJAS_BUILDING_DLL -Dlibjasper_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_jasper/jasper/work/build/src/libjasper/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_jasper/jasper/work/jasper-3.0.6/src/libjasper/include -isystem /opt/local/include -pipe -Os -pedantic -arch ppc -mmacosx-version-min=10.5 -fPIC -fvisibility=hidden -Wall -W -Wno-sign-compare -Wformat -Wmissing-prototypes -Wstrict-prototypes -Wno-type-limits -Wno-tautological-constant-out-of-range-compare -Wno-stringop-truncation -Wno-stringop-overflow -Wmissing-declarations -std=gnu11 -MD -MT src/libjasper/CMakeFiles/libjasper.dir/base/jas_cm.c.o -MF CMakeFiles/libjasper.dir/base/jas_cm.c.o.d -o CMakeFiles/libjasper.dir/base/jas_cm.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_jasper/jasper/work/jasper-3.0.6/src/libjasper/base/jas_cm.c
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_jasper/jasper/work/jasper-3.0.6/src/libjasper/include/jasper/jas_cm.h:77:0,
                 from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_jasper/jasper/work/jasper-3.0.6/src/libjasper/base/jas_cm.c:74:
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_jasper/jasper/work/jasper-3.0.6/src/libjasper/include/jasper/jas_types.h:187:25: error: conflicting types for 'max_align_t'
     typedef long double max_align_t;
                         ^~~~~~~~~~~
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_jasper/jasper/work/jasper-3.0.6/src/libjasper/include/jasper/jas_types.h:76:0,
                 from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_jasper/jasper/work/jasper-3.0.6/src/libjasper/include/jasper/jas_cm.h:77,
                 from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_jasper/jasper/work/jasper-3.0.6/src/libjasper/base/jas_cm.c:74:
/opt/local/lib/gcc7/gcc/ppc-apple-darwin9/7.5.0/include/stddef.h:437:3: note: previous declaration of 'max_align_t' was here
 } max_align_t;
   ^~~~~~~~~~~
cc1: warning: unrecognized command line option '-Wno-stringop-truncation'
cc1: warning: unrecognized command line option '-Wno-tautological-constant-out-of-range-compare'
make[2]: *** [src/libjasper/CMakeFiles/libjasper.dir/base/jas_cm.c.o] Error 1

The original definition seems to come from GCC 7:

typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 437 "/opt/local/lib/gcc7/gcc/ppc-apple-darwin9/7.5.0/include/stddef.h" 3 4
} max_align_t;

In jasper-3.0.6/src/libjasper/include/jasper/jas_types.h we have:

  155	/* The number of bits in the integeral type uint_fast32_t. */
  156	/* NOTE: This could underestimate the size on some exotic architectures. */
  157	#define JAS_UINTFAST32_NUMBITS (8 * sizeof(uint_fast32_t))
  158	
  159	#if 0
  160	#if defined(JAS_HAVE_MAX_ALIGN_T)
  161	#define	jas_max_align_t	max_align_t
  162	#else
  163	#define	jas_max_align_t	long double
  164	#endif
  165	#endif

This file has the date of today, because:

--->  Applying max_align_t.patch

Probably this patch is inadequate. The pre-processed output has:

typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 437 "/opt/local/lib/gcc7/gcc/ppc-apple-darwin9/7.5.0/include/stddef.h" 3 4
} max_align_t;
# 77 "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_jasper/jasper/work/jasper-3.0.6/src/libjasper/include/jasper/jas_types.h" 2
.
.
.
# 187 "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_jasper/jasper/work/jasper-3.0.6/src/libjasper/include/jasper/jas_types.h"
   typedef long double max_align_t;
# 78 "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_jasper/jasper/work/jasper-3.0.6/src/libjasper/include/jasper/jas_cm.h" 

Wouldn't commenting the typedef in jasper-3.0.6/src/libjasper/include/jasper/jas_types.h be adequate?

Attachments (1)

main.log (29.5 KB) - added by ballapete (Peter "Pete" Dyballa) 2 years ago.
Main.log from PPC Leopard

Download all attachments as: .zip

Change History (6)

Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

Main.log from PPC Leopard

comment:1 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

Actually it's this block in jasper-3.0.6/src/libjasper/include/jasper/jas_types.h that redefines max_align_t:

  167	/*
  168	Assume that a compiler claiming to be compliant with C11 or a later version
  169	of the C standard provides a suitable definition of max_align_t.
  170	The JAS_NO_SET_MAX_ALIGN_T preprocessor symbol can be used to override
  171	this behavior.
  172	*/
  173	#if defined(JAS_NO_SET_MAX_ALIGN_T)
  174		/*
  175		The user of this header is assuming responsibility for providing a
  176		suitable definition for max_align_t.
  177		*/
  178	#elif defined(_MSC_VER)
  179		/*
  180		Define max_align_t as a preprocessor symbol since using typedef will
  181		cause problems.
  182		*/
  183	#	define max_align_t long double
  184	#elif !(defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 201112L))
  185	#	define max_align_t long double
  186	#else
  187	    typedef long double max_align_t;
  188	#endif

The patch adds lines #186 and #187 – which is too much! Or? (I'll test without that patch when glib2 has built.)

comment:2 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

JasPer built on PPC Leopard, Mac OS X 10.5.8, without the max_align_t.patch.

comment:3 Changed 2 years ago by jmroot (Joshua Root)

Resolution: duplicate
Status: newclosed

comment:4 in reply to:  3 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

Replying to jmroot:

#65819

GCC 12 does not seem to build on Leopard.

comment:5 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

The recent version of JasPer does not seem to be prepared for (old) Mac OS X. When building netpbm or libraw messages like these appear:

libtool: compile:  /opt/local/bin/g++-mp-7 -DPACKAGE_NAME=\"LibRaw\" -DPACKAGE_TARNAME=\"libraw\" -DPACKAGE_VERSION=\"0.20.2\" "-DPACKAGE_STRING=\"LibRaw 0.20.2\"" -DPACKAGE_BUGREPORT=\"info@libraw.org\" -DPACKAGE_URL=\"http://www.libraw.org\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_JPEGLIB_H=1 -DHAVE_JASPER_JASPER_H=1 -I. -I/opt/local/include -DUSE_JPEG -DUSE_JPEG8 -DUSE_JASPER -DUSE_ZLIB -DUSE_LCMS2 -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -MT src/libraw_datastream.lo -MD -MP -MF src/.deps/libraw_datastream.Tpo -c src/libraw_datastream.cpp  -fno-common -DPIC -o src/.libs/libraw_datastream.o
In file included from /opt/local/include/jasper/jasper.h:73:0,
                 from src/libraw_datastream.cpp:31:
/opt/local/include/jasper/jas_config.h:115:2: warning: #warning "Your code is being built against an older version of the C standard than JasPer was.  Although this is supported, this may require some extra preprocessor defines when building." [-Wcpp]
 #warning "Your code is being built against an older version of the C standard than JasPer was.  Although this is supported, this may require some extra preprocessor defines when building."
  ^~~~~~~

libtool: compile:  /opt/local/bin/g++-mp-7 -DPACKAGE_NAME=\"LibRaw\" -DPACKAGE_TARNAME=\"libraw\" -DPACKAGE_VERSION=\"0.20.2\" "-DPACKAGE_STRING=\"LibRaw 0.20.2\"" -DPACKAGE_BUGREPORT=\"info@libraw.org\" -DPACKAGE_URL=\"http://www.libraw.org\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_JPEGLIB_H=1 -DHAVE_JASPER_JASPER_H=1 -I. -I/opt/local/include -DUSE_JPEG -DUSE_JPEG8 -DUSE_JASPER -DUSE_ZLIB -DUSE_LCMS2 -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -MT src/decoders/canon_600.lo -MD -MP -MF src/decoders/.deps/canon_600.Tpo -c src/decoders/canon_600.cpp  -fno-common -DPIC -o src/decoders/.libs/canon_600.o
In file included from /opt/local/include/jasper/jasper.h:73:0,
                 from ./internal/defines.h:73,
                 from src/decoders/../../internal/dcraw_defs.h:24,
                 from src/decoders/canon_600.cpp:19:
/opt/local/include/jasper/jas_config.h:115:2: warning: #warning "Your code is being built against an older version of the C standard than JasPer was.  Although this is supported, this may require some extra preprocessor defines when building." [-Wcpp]
 #warning "Your code is being built against an older version of the C standard than JasPer was.  Although this is supported, this may require some extra preprocessor defines when building."
  ^~~~~~~
/usr/bin/gcc-4.2 -c -I.  -Iimportinc -Iimportinc/netpbm -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_netpbm/netpbm/work/advanced-r4392/converter/other/jpeg2000  -I/opt/local/include -DNDEBUG  -Os -fno-common -D_DARWIN_C_SOURCE -I/opt/local/include -arch ppc   -Os -fno-common -D_DARWIN_C_SOURCE -I/opt/local/include -arch ppc  -o pamtojpeg2k.o pamtojpeg2k.c
In file included from /opt/local/include/jasper/jasper.h:73,
                 from pamtojpeg2k.c:23:
/opt/local/include/jasper/jas_config.h:115:2: warning: #warning "Your code is being built against an older version of the C standard than JasPer was.  Although this is supported, this may require some extra preprocessor defines when building."
Note: See TracTickets for help on using tickets.