You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2018/02/18 21:22:26 UTC

[Issue 127712] New: Allow building when gcc -dumpversion does not use the canonical x.y.z format

https://bz.apache.org/ooo/show_bug.cgi?id=127712

          Issue ID: 127712
        Issue Type: DEFECT
           Summary: Allow building when gcc -dumpversion does not use the
                    canonical x.y.z format
           Product: Build Tools
           Version: 4.2.0-dev
          Hardware: All
                OS: All
            Status: CONFIRMED
          Severity: Normal
          Priority: P5 (lowest)
         Component: solenv
          Assignee: issues@openoffice.apache.org
          Reporter: pescetti@apache.org
  Target Milestone: ---

Code in main/solenv/inc/tg_compv.mk and main/solenv/bin/getcompver.awk assumes
that "gcc -dumpversion" will return a canonical version number in the form
x.y.z.

Unfortunately, recent GCC versions no longer guarantee this convention:

https://gcc.gnu.org/onlinedocs/gcc/Developer-Options.html#index-dumpversion

"Print the compiler version (for example, 3.0, 6.3.0 or 7)—and don’t do
anything else. This is the compiler version used in filesystem paths, specs,
can be depending on how the compiler has been configured just a single number
(major version), two numbers separated by dot (major and minor version) or
three numbers separated by dots (major, minor and patchlevel version)."

The right one to use would be -dumpfullversion (same URL):

"Print the full compiler version, always 3 numbers separated by dots, major,
minor and patchlevel version."

Unfortunately, it seems (but I haven't checked yet) that old gcc versions do
not support -dumpfullversion.

Note: "6.3" does not mean "6.3.0"; you can get "6.3" for "6.3.0" or "6.3.1",
and you can get "7" for "7.0.0", "7.3.0", "7.3.1"... the version is simply
truncated, and configuration depends on the distribution.

When the output is in the form "x.y", we already expand it to "x.y.0", which is
wrong (see above).

The following patch to main/solenv/bin/getcompver.awk extends it to expand "7"
to "7.0.0" and is equally wrong, but it allows the build to continue.

---
@@ -46,6 +46,13 @@
     x = match( $0, /[0-9]*\.[0-9]*\.[0-9]*/ )
     CCversion = substr( $0, RSTART, RLENGTH)
 }
+/^[0-9]*\x0d*$/ {
+    if ( compiler_matched == 0 ) {
+    # Comparison assumes the compiler version is reported as x.y.z.
+    # For GCC one should use -dumpfullversion but it won't work on old
versions.
+       CCversion = $0 ".0.0"
+    }
+}
 /^[0-9]*[.][0-9]*\x0d*$/ {
     if ( compiler_matched == 0 ) {
 # need to blow to x.xx.xx for comparing
---

The proper solution is: test if -dumpfullversion is supported and use its
output in case, otherwise revert to -dumpversion and go through all current
hacks.

Note that the awk file is not specific to gcc, so changes must go in
main/solenv/inc/tg_compv.mk

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127712] Allow building when gcc -dumpversion does not use the canonical x.y.z format

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127712

--- Comment #10 from SVN Robot <sv...@dev.null.org> ---
"mseidel" committed SVN revision 1846401 into trunk:
i127712 - Allow building when gcc -dumpversion does not use the canonical
x.y...

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127712] Allow building when gcc -dumpversion does not use the canonical x.y.z format

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127712

Peter <pe...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|4.1.6_release_blocker?      |4.1.6_release_blocker+
                 CC|                            |petko@apache.org

--- Comment #7 from Peter <pe...@apache.org> ---
Accepted for 4.1.6

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127712] Allow building when gcc -dumpversion does not use the canonical x.y.z format

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127712

Andrea Pescetti <pe...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |4.1.6_release_blocker?

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127712] Allow building when gcc -dumpversion does not use the canonical x.y.z format

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127712

Ash <ke...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kerriganblade@gmail.com

--- Comment #1 from Ash <ke...@gmail.com> ---
Found one nice way of solving this without having to implement any complex
logic.
Please see attached pic for solution.

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127712] Allow building when gcc -dumpversion does not use the canonical x.y.z format

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127712

--- Comment #2 from Ash <ke...@gmail.com> ---
Created attachment 86360
  --> https://bz.apache.org/ooo/attachment.cgi?id=86360&action=edit
possible solution for gcc -dumpversion

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127712] Allow building when gcc -dumpversion does not use the canonical x.y.z format

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127712

Andrea Pescetti <pe...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|CONFIRMED                   |RESOLVED

--- Comment #8 from Andrea Pescetti <pe...@apache.org> ---
This is now committed to AOO416 with r1843953 since we already had the
necessary approval from Peter above.

Thank you Ash for your contribution!

(this is NOT committed to trunk due to the changes outlined by Matthias above)

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127712] Allow building when gcc -dumpversion does not use the canonical x.y.z format

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127712

--- Comment #3 from Andrea Pescetti <pe...@apache.org> ---
Very nice solution! If old gcc versions indeed behave like this and simply
ignore the option they don't support (when given both), then please feel free
to turn this into a patch against trunk, attach it here, and I will commit it
for you.

-- 
You are receiving this mail because:
You are the assignee for the issue.

4.1.6_release_blocker requested: [Issue 127712] Allow building when gcc -dumpversion does not use the canonical x.y.z format

Posted by bu...@apache.org.
Andrea Pescetti <pe...@apache.org> has asked  for 4.1.6_release_blocker:
Issue 127712: Allow building when gcc -dumpversion does not use the canonical
x.y.z format
https://bz.apache.org/ooo/show_bug.cgi?id=127712

[Issue 127712] Allow building when gcc -dumpversion does not use the canonical x.y.z format

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127712

Arrigo Marchiori <ar...@yahoo.it> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ardovm@yahoo.it

--- Comment #9 from Arrigo Marchiori <ar...@yahoo.it> ---
Created attachment 86542
  --> https://bz.apache.org/ooo/attachment.cgi?id=86542&action=edit
Patch to configure.ac that calls gcc with both version dump parameters

This patch applies the same logic to the configure.ac file, and therefore
should be applicable to trunk.

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127712] Allow building when gcc -dumpversion does not use the canonical x.y.z format

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127712

Matthias Seidel <ms...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://bz.apache.org/ooo/s
                   |                            |how_bug.cgi?id=127664
                 CC|                            |mseidel@apache.org

--- Comment #5 from Matthias Seidel <ms...@apache.org> ---
Note:

main/solenv/inc/tg_compv.mk has been deleted from trunk with r1826296.

Logic was moved to configure.

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127712] Allow building when gcc -dumpversion does not use the canonical x.y.z format

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127712

Andrea Pescetti <pe...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.6

--- Comment #6 from Andrea Pescetti <pe...@apache.org> ---
Apparently I can't set a flag for this component, but I'd like to suggest this
for 4.1.6: it allows building (or at least getting past the configure stage)
when GCC reports its version in an unusual way.

Note: no immediate port from/to trunk is foreseen since as Matthias noted we do
things differently in trunk.

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127712] Allow building when gcc -dumpversion does not use the canonical x.y.z format

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127712

--- Comment #4 from Ash <ke...@gmail.com> ---
Created attachment 86364
  --> https://bz.apache.org/ooo/attachment.cgi?id=86364&action=edit
gcc version for both old and new

-- 
You are receiving this mail because:
You are the assignee for the issue.

4.1.6_release_blocker granted: [Issue 127712] Allow building when gcc -dumpversion does not use the canonical x.y.z format

Posted by bu...@apache.org.
Peter <pe...@apache.org> has granted Andrea Pescetti <pe...@apache.org>'s
request for 4.1.6_release_blocker:
Issue 127712: Allow building when gcc -dumpversion does not use the canonical
x.y.z format
https://bz.apache.org/ooo/show_bug.cgi?id=127712



--- Comment #7 from Peter <pe...@apache.org> ---
Accepted for 4.1.6