Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#60906 closed defect (fixed)

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"

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: ken-cunningham-webuse
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: tiger Cc:
Port: libraw

Description

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@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.

Attachments (2)

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

Download all attachments as: .zip

Change History (6)

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

Attachment: main.log added

Main.log from PPC Tiger

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

The same happens on PPC Leopard, Mac OS X 10.5.8.

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

Attachment: main.2.log added

Main.log from PPC Leopard

comment:2 Changed 4 years ago by kencu (Ken)

I am not sure how to fix this to build with gcc-4.2 (if it can be fixed) but building it with gcc7 works (on 10.5 PPC so far).

comment:3 Changed 4 years ago by ken-cunningham-webuse

Owner: set to ken-cunningham-webuse
Resolution: fixed
Status: newclosed

In ff7fdda0758dab9c85114bd3ee9f7134593bf1f0/macports-ports (master):

libraw: blacklist gcc-4.2 and ilk

closes: #60906

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

Replying to kencu:

I am not sure how to fix this to build with gcc-4.2 (if it can be fixed) but building it with gcc7 works (on 10.5 PPC so far).

Works on 10.4 (Tiger) PPC as well!

Note: See TracTickets for help on using tickets.