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

[TESTBUG] regression Test7107135 needs to remove dependence on locally installed gcc



    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 9
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:



        Regression Test7107135 compiles and links a simple JNI library, once with the execstack attribute and one with noexecstack. It has a shell scripts that expects to be able to do this on the test device. The issue is that not all test devices will have gcc installed. When they don't, the tests silently passes. The test should be rewritten so the libraries are cross compiled.

        The following is from Stefan Sarne and suggests how to resolve the device compilation issue, and also some other improvements for the test:

        As stated by Mikael and Leonid, the idea is to let the build step handle the build of test libs as well.

        Support for building native libraries was recently added to jdk9 by Magnus in the build-dev. It is currently not possible to pass in flags to the linker. But he agrees it make sense to be able to do and he already has a patch out for adding it. See JDK-8081471 and mail to build-dev.

        It will be possible to add flags per file/lib name.
        So in this case there will have to be two versions of test.c, say test-rw.c and test-rwx.c.
        On the other hand - hopefully you can get rid of the bash script.

        Some other suggestions regarding the test:
         - A new and better alternative to "silently pass on non-Linux", is to use the @requires tag.
           The test will then be run on Linux, but skipped on other platforms where it isn't applicable.
           The benefit is that the risk for thinking that the test is run and passes is reduced.
           See hotspot/test/closed/runtime/4475963/Test4475963.sh:8:## @requires os.family=="linux"

         - Bug ID as name is awkward to work with. The bug id is available as key in the test so a more descriptive name is preferred.

         - Favor java and @run driver over tests written in bash
           For example see ./runtime/CommandLine/TestNullTerminatedFlags.java


            Issue Links



                gthornbr Gerald Thornbrugh (Inactive)
                cjplummer Chris Plummer
                0 Vote for this issue
                4 Start watching this issue