Menu

#320 OS X universal build failure

v1.0_(example)
closed-fixed
None
5
2015-10-05
2015-10-05
No

Hello, I'm the maintainer of GraphicsMagick in the MacPorts package management system. GraphicsMagick 1.3.22 breaks OS X universal builds (i.e. builds for more than one architecture simultaneously). This is because code was added to configure.ac to remove "duplicate" flags from CFLAGS and LDFLAGS. A universal build is accomplished by passing e.g. "-arch x86_64 -arch i386" in CFLAGS, CXXFLAGS and LDFLAGS. This means "build for the architecture x86_64 and also for the architecture i386". Your code that removes "duplicate" flags reduces this to "-arch x86_64 i386" in the CFLAGS and LDFLAGS which is an error and causes the build to fail. The configure summary says:

Options used to compile and link:
  CC       = ccache /usr/bin/clang
  CFLAGS   = -pipe -Os -arch x86_64 i386 -Wall -D_THREAD_SAFE
  CPPFLAGS = -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libxml2
  CXX      = ccache /usr/bin/clang++
  CXXFLAGS = -pipe -Os -stdlib=libc++ -arch x86_64 -arch i386 -D_THREAD_SAFE
  DEFS     = -DHAVE_CONFIG_H
  LDFLAGS  = -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 i386
  LIBS     = -lwebp -llcms2 -ltiff -lfreetype -ljasper -ljpeg -lpng16 -llzma -lbz2 -lxml2 -lz -lm -lpthread

The build fails with:

clang: error: no such file or directory: 'i386'

This problem was not present in GraphicsMagick 1.3.21. Please remove the flag deduplication code. The same problem affected the ImageMagick project recently, when they briefly added flag deduplication code. They fixed the problem by removing the flag deduplication code.

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2015-10-05
    • status: open --> closed-fixed
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2015-10-05

    Sorry for introducing the problem. Hopefully you are able to patch configure directly or patch configure.ac and autoreconf to temporarily work around the problem.

    The deduplication code was added because some existing -config scripts result in doubling the amount of build options. Doubled build options are obviously preferable to options being deleted.

    The fix is now in Mercurial as changeset 62387f365b84.

     
  • Ryan Carsten Schmidt

    Thank you very much!

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2015-10-05

    I would appreciate if you would verify that the GM 1.4 snapshot that I produced this morning builds without additional failures. The purpose of development snapshots is supposed to be to avoid festering problems which are not discovered until release.

     

Log in to post a comment.