Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-7738

rootcling_tmp incorrectly build when "linux" is in full path name

    XMLWordPrintable

    Details

      Description

      The rootcling_tmp.cxx file is compiled using -DR__LLVMRESOURCEDIR=<resource-directory-path>" and the path is substituted using the macro "stringify(s)" which expands to #s. When building in a directory that contains "linux" in the path (e.g. "/tmp/x86_64-linux-gcc5/build"), this interacts poorly with the non-posix definition of the macro "linux:" (resulting in a resource path containing /tmp/x86_64--gcc5/build) and the build fails. The fundamental problem is that if the compilation path contains a string that happens to match a defined macro, the compilation will fail.

      I've checked at gcc5 as compiled by Debian defines the macro "linux". If it is not defined by the compiler, it will be defined in RConfig.h which contains the lines

      #if defined(__linux) || defined(__linux__)
      #   ifndef linux
      #      define linux
      #   endif
      #endif

      I've verified this compiling ROOT 6.04.06 with cmake, however I suspect it applies to other versions. The work around is to change the compilation location (sometimes difficult). A possible fix is to change rootcling.cxx to not depend on cpp to substitute the resource directory name during the build (e.g. use a search-replace while copying to rootcling_tmp.cxx),

      Thanks!

        Attachments

          Activity

            People

            • Assignee:
              mato Pere Mato Vila
              Reporter:
              0262498104ed5e52b217 Clark McGrew
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Actual End: