Vrui build fails with GCC 10

Home Forums AR Sandbox Forum Vrui build fails with GCC 10

Tagged: 

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #125136
    Sean Robinson
    Participant

    The following patch to Vrui fixes building with GCC 10.

    --- a/BuildRoot/SystemDefinitions
    +++ b/BuildRoot/SystemDefinitions
    @@ -186,13 +186,16 @@
       PLAINCCOMP = $(GNUC_BASEDIR)/gcc
     endif
    
    +COMPVER = $(shell $(BASECCOMP) -dumpversion)
    +GTE = $(shell printf '%s\n' $(1) $(2) | sort -V | tail -n 1)
    +
     # Check for the compiler type as it influences ABI and standard strictness
    -ifeq ($(shell expr <code>$(BASECCOMP) -dumpversion</code> ">=" "3.0.0"),1)
    +ifeq ($(call GTE,$(COMPVER),"3.0.0"),$(COMPVER))
       COMPILERTYPE = g++-3
       # gcc versions 3.0.0 and up create dependency file with the same
       # root name and in the same directory as the created object file
       DEPFILETEMPLATE = '$(patsubst %.o,%.d,$@)'
    -  ifeq ($(shell expr <code>$(BASECCOMP) -dumpversion</code> ">=" "4.1.0"),1)
    +  ifeq ($(call GTE,$(COMPVER),"4.1.0"),$(COMPVER))
     		# gcc version 4.1.0 and up provide built-in atomics:
     		SYSTEM_HAVE_ATOMICS = 1
       endif
    

    The problem source is that expr tries to convert its parameters to
    integers. When that fails, 3.0.0 and 10.2.0 are sorted lexicographically,
    where that order is 10.2.0 before 3.0.0.

    The above patch uses sort -V for natural sorting of version numbers.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Comments are closed.