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

Fix issues with build when things go wrong during linking or mapfile production

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      Kelly writes in reference to:

      sh /tmp/jprt/P1/B/212610.coleenp/source/make/linux/makefiles/build_vm_def.sh *.o > vm.def
      /tmp/jprt/P1/B/212610.coleenp/source/make/linux/makefiles/build_vm_def.sh: line 10: /opt/jprt/products/P1/ccache2.4/bin/nm: No such file or directory

      If nm doesn't exist, then this shell script will fail, but return exit code 0, and the makefile will not stop but create a bogus mapfile, which may or may not allow libjvm.so to link. I think this shell script needs to use 'set -e' or do something like (nm || exit 1) | awk or maybe both. Can we fix this shell script?

      In addition. I'd like to see some makefile verifications that the tools actually exist, something like

      # Check fullpath tool
      define filecheck # fullpath
      $(if $(wildcard $1),$1,$(error "ERROR: File does not exist: $1"))
      endef

      # Check tools
      ifdef CROSS_COMPILE_ARCH
        ifdef ALT_COMPILER_PATH
          CC := $(call filecheck,$(ALT_COMPILER_PATH)/gcc)
          CPP := $(call filecheck,$(ALT_COMPILER_PATH)/g++)
          NM := $(call filecheck,$(ALT_COMPILER_PATH)/nm)
          STRIP := $(call filecheck,$(ALT_COMPILER_PATH)/strip)
        endif
      endif

      David adds: in addition to above issues when a link error does occur the makefiles will create invalid self-links eg:

      [ -f libjsig.so ] || { ln -s libjsig.so libjsig.so; }

      If the lib does not exist then we create a symbolic link that points to itself! This happens for all the main libs and the gamma executable. If creation of the .so or executable fails then we get a self-link created, and that then causes errors on subsequent attempts to rebuild as stat will report an error "Too many levels of symbolic links". You then have to manually delete the symbolic link to proceed.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: