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

make reconfigure loses original CC/CXX env-var overrides

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • infrastructure
    • None

      Fell into this UX trap recently. The system has both GCC 7.3.1 (default) and GCC 10.5.0 (as separate package). It is possible to configure with GCC 10 by overriding the env-vars:

      % CC=gcc10-gcc CXX=gcc10-g++ bash ./configure --with-debug-level=fastdebug --with-boot-jdk=../jdk-24
      ...
      Tools summary:
      * C Compiler: Version 10.5.0 (at /usr/bin/gcc10-gcc)
      * C++ Compiler: Version 10.5.0 (at /usr/bin/gcc10-g++)

      BUT, it does not persist with `make reconfigure`:

      $ CONF=linux-x86_64-server-fastdebug make reconfigure
      ...
      Tools summary:
      * C Compiler: Version 7.3.1 (at /usr/bin/gcc)
      * C++ Compiler: Version 7.3.1 (at /usr/bin/g++)

      It makes some sense, since configure likely does not capture "external" env-vars. This one works more reliably:

      % bash ./configure --with-debug-level=fastdebug --with-boot-jdk=../jdk-24 CC=gcc10-gcc CXX=gcc10-g++

      Tools summary:
      * C Compiler: Version 10.5.0 (at /usr/bin/gcc10-gcc)
      * C++ Compiler: Version 10.5.0 (at /usr/bin/gcc10-g++)

      % CONF=linux-x86_64-server-fastdebug make reconfigure
      * C Compiler: Version 10.5.0 (at /usr/bin/gcc10-gcc)
      * C++ Compiler: Version 10.5.0 (at /usr/bin/gcc10-g++)

      The following warnings were produced. Repeated here for convenience:
      WARNING: The following variables might be unknown to configure: CC CXX


      So there are two questions:
       1. Should we capture the env-var CC/CXX overrides for the sake for `make reconfigure`? This probably opens a pandora box of asking about LD, OBJDUMP, etc.
       2. Should we detect the env-var CC/CXX overrides and warn users to use configure options instead? Probably more useful and user-friendly.

            Unassigned Unassigned
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: