[MacPorts] #60906: libraw @0.20.0 does not build on PPC Tiger, Mac OS X 10.4.11, because "integer constant is too large for 'long' type"

MacPorts noreply at macports.org
Sun Jul 26 22:13:39 UTC 2020


#60906: libraw @0.20.0 does not build on PPC Tiger, Mac OS X 10.4.11, because
"integer constant is too large for 'long' type"
-----------------------+--------------------
 Reporter:  ballapete  |      Owner:  (none)
     Type:  defect     |     Status:  new
 Priority:  Normal     |  Milestone:
Component:  ports      |    Version:  2.6.3
 Keywords:  tiger      |       Port:  libraw
-----------------------+--------------------
 {{{
 libtool: compile:  /opt/local/bin/g++-apple-4.2 -DPACKAGE_NAME=\"LibRaw\"
 -DPACKAGE_TARNAME=\"libraw\" -DPACKAGE_VERSION=\"0.20.0\"
 "-DPACKAGE_STRING=\"LibRaw 0.20.0\""
 -DPACKAGE_BUGREPORT=\"info at libraw.org\"
 -DPACKAGE_URL=\"http://www.libraw.org\\
 " -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=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 -arch ppc -MT
 src/metadata/tiff.lo -MD -MP -MF src/metadata/.deps/tiff.Tpo -c
 src/metadata/tiff.cpp  -fno-common -DPIC -o src/m\
 etadata/.libs/tiff.o
 src/metadata/tiff.cpp:244: error: integer constant is too large for 'long'
 type
 src/metadata/tiff.cpp:247: error: integer constant is too large for 'long'
 type
 make: *** [src/metadata/tiff.lo] Error 1
 make: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_libraw/libraw/work/LibRaw-0.20.0'
 Command failed:  cd
 "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_libraw/libraw/work/LibRaw-0.20.0"
 && /usr/bin/make -w all
 Exit code: 2
 }}}

 The source code is:

 {{{
   243         case 0x1202:
   244           if (ilm.LensID != 0xffffffffffffffff) {
   245             utmp = (fgetc(ifp) << 8) | fgetc(ifp);
   246             if (utmp) ilm.LensID += utmp;
   247             else ilm.LensID = 0xffffffffffffffff;
   248           }
   249           break;
 }}}

 which is pre-processed to (by using '-E -dD'):

 {{{
       case 0x1202:
         if (imgdata.lens.makernotes.LensID != 0xffffffffffffffff) {
           utmp = (libraw_internal_data.internal_data.input->get_char() <<
 8) | libraw_internal_data.internal_data.input->get_char();
           if (utmp) imgdata.lens.makernotes.LensID += utmp;
           else imgdata.lens.makernotes.LensID = 0xffffffffffffffff;
         }
         break;
 }}}

 `imgdata´ is defined as:

 {{{
   libraw_data_t imgdata;
 }}}

 meaning it's a

 {{{
   typedef struct
   {
     ushort (*image)[4];
     libraw_image_sizes_t sizes;
     libraw_iparams_t idata;
     libraw_lensinfo_t lens;
     libraw_makernotes_t makernotes;
     libraw_shootinginfo_t shootinginfo;
     libraw_output_params_t params;
     unsigned int progress_flags;
     unsigned int process_warnings;
     libraw_colordata_t color;
     libraw_imgother_t other;
     libraw_thumbnail_t thumbnail;
     libraw_rawdata_t rawdata;
     void *parent_class;
   } libraw_data_t;
 }}}

 Here `lens` is defined as of type `libraw_lensinfo_t` which is:

 {{{
   typedef struct
   {
     float MinFocal, MaxFocal, MaxAp4MinFocal, MaxAp4MaxFocal, EXIF_MaxAp;
     char LensMake[128], Lens[128], LensSerial[128],
 InternalLensSerial[128];
     ushort FocalLengthIn35mmFormat;
     libraw_nikonlens_t nikon;
     libraw_dnglens_t dng;
     libraw_makernotes_lens_t makernotes;
   } libraw_lensinfo_t;
 }}}

 `makernotes` is of type `libraw_makernotes_lens_t`:

 {{{
   typedef struct
   {
     unsigned long long LensID;
     char Lens[128];
     ushort LensFormat;
     ushort LensMount;
     unsigned long long CamID;
     ushort CameraFormat;
     ushort CameraMount;
     char body[64];
     short FocalType;
     char LensFeatures_pre[16], LensFeatures_suf[16];
     float MinFocal, MaxFocal;
     float MaxAp4MinFocal, MaxAp4MaxFocal, MinAp4MinFocal, MinAp4MaxFocal;
     float MaxAp, MinAp;
     float CurFocal, CurAp;
     float MaxAp4CurFocal, MinAp4CurFocal;
     float MinFocusDistance;
     float FocusRangeIndex;
     float LensFStops;
     unsigned long long TeleconverterID;
     char Teleconverter[128];
     unsigned long long AdapterID;
     char Adapter[128];
     unsigned long long AttachmentID;
     char Attachment[128];
     ushort FocalUnits;
     float FocalLengthIn35mmFormat;
   } libraw_makernotes_lens_t;
 }}}

 And so we have found that `imgdata.lens.makernotes.LensID` is a `unsigned
 long long` `integer`. I think that some extra steps need to be taken that
 Tiger handles `long long` data types. At least I saw that `configure`
 steps of a few ports failed to determine that Tiger can handle data types
 longer than 32 bits.

-- 
Ticket URL: <https://trac.macports.org/ticket/60906>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list