Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-15435

clang: error: unknown argument: '-fwhole-program'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.2.12
    • Fix Version/s: 10.2
    • Component/s: Compiling
    • Labels:
      None
    • Environment:
      OS X Mavericks 10.9.5, Xcode 6.2

      Description

      mariadb 10.2.12 fails to build on OS X Mavericks 10.9.5 with the error:

      clang: error: unknown argument: '-fwhole-program'

      This is with clang version Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) as provided by Xcode 6.2, which is the last version of Xcode that is compatible with Mavericks.

      Newer versions of clang, such as the one in macOS High Sierra 10.13.3 display this warning instead:

      clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]

      Here is the commit where the "feature" of ignoring this flag was added to clang:

      https://github.com/llvm-mirror/clang/commit/226bee35958fc978afb818b247601bcfa01d31fa

      Looking at the mariadb build system, it deliberately adds -fwhole-program only on Apple systems. But this appears to be pointless since Apple systems default to clang which doesn't support that option. Here is the commit where the flag was added to mariadb, though the commit is huge and doesn't explain itself:

      https://github.com/MariaDB/server/commit/f853a99a4fad0f390d6b1f6c46648302ca6cf310

      For more information, and build logs, see https://trac.macports.org/ticket/55915

        Attachments

          Activity

            People

            Assignee:
            cvicentiu Vicențiu Ciorbaru
            Reporter:
            ryandesign Ryan Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: