Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8067060

build can still fail with spaces following -L on link lines

XMLWordPrintable

    • b46
    • os_x

        I still observe build failures caused by space(s) separating the -L from its following argument on linker command lines, even after the fix for JDK-8066752 was applied. The trailing spaces after -L have been removed from the appropriate make rules, but apparently the INSTALL_LIBRARIES_HERE variable which follows it still has a leading space.

        Here's a patch to the jdk repo that strips that variable:

        ============================================================
        diff -r cb475099ceac make/lib/LibCommon.gmk
        --- a/make/lib/LibCommon.gmk Tue Dec 09 09:22:07 2014 -0800
        +++ b/make/lib/LibCommon.gmk Tue Dec 09 14:27:27 2014 -0800
        @@ -79,9 +79,7 @@
         # Param 2 - library name
         # Param 3 - subdir for library
         define FindLib
        -$(strip \
        - $(call FindLibDirForModule, $(strip $1))$(strip $3)/$(LIBRARY_PREFIX)$(strip $2)$(SHARED_LIBRARY_SUFFIX) \
        -)
        + $(call FindLibDirForModule, $(strip $1))$(strip $3)/$(LIBRARY_PREFIX)$(strip $2)$(SHARED_LIBRARY_SUFFIX)
         endef
         
         ################################################################################
        @@ -89,7 +87,7 @@
         LIBJAVA_HEADER_FLAGS := $(addprefix -I, $(call FindSrcDirsForLib, java.base, java))
         
         # Put the libraries here.
        -INSTALL_LIBRARIES_HERE := $(call FindLibDirForModule, $(MODULE))
        +INSTALL_LIBRARIES_HERE := $(strip $(call FindLibDirForModule, $(MODULE)))
         
         ################################################################################
         
        ============================================================

        Mainly this adds a "strip" call to the definition of the INSTALL_LIBRARIES_HERE variable.
        Just for grins this patch also reverts the "strip" call from the FindLib macro that was added by the fix for JDK-8066752. My build succeeded with this patch in place.

        Of course it might also be reasonable to leave the "strip" in the FindLib macro. I make no claim for this patch other than it worked for me. It might be better to put the strip call(s) elsewhere. But it does seem that spaces need to be stripped from the value of
        the INSTALL_LIBRARIES_HERE variable at some point.

              erikj Erik Joelsson
              smarks Stuart Marks
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: