[build2] Using build2 with avr-g++

Wilhelm Meier wilhelm.meier at hs-kl.de
Fri May 5 07:57:01 UTC 2023


Is there anything I can help with?


> Modified the build file (target) to:
> 
> config.cxx = /usr/local/bin/avr-g++
> 
> cxx.std = experimental
> cxx.features.modules = true
> 
> config.cxx.target = avr-none-none
> 
> using cxx
> 
> assert $cxx.features.modules "no modules support for $cxx.signature"
> 
> mxx{*}: extension = mpp
> cxx{*}: extension = cpp
> 
> exe{hello}: {cxx mxx}{*}
> 
> Now I get an assertion-failure of build2:
> 
> $ b -sV
> LC_ALL=C /usr/local/bin/avr-g++ -v
> /usr/local/bin/avr-g++ -x c++ -E -
> /usr/local/bin/avr-g++ -x c++ -E -
> bin @/home/lmeier/test/
> target     avr-none
> pattern    /usr/local/bin/avr-*
> LC_ALL=C /usr/local/bin/avr-ar --version
> bin.ar @/home/lmeier/test/
> ar         /usr/local/bin/avr-ar
> id         gnu
> version    2.32.51.20190207
> major      2
> minor      32
> patch      51
> build      .20190207
> signature  GNU ar (GNU Binutils) 2.32.51.20190207
> checksum   dcf86b4f2a4e9ae59bc8a2f3b5112fa9cd17209f51a5ddb4fe020b15c93d2d74
> LC_ALL=C /usr/local/bin/avr-g++ -std=c++23 -fmodules-ts -print-search-dirs
> LC_ALL=C /usr/local/bin/avr-g++ -std=c++23 -fmodules-ts -x c++ -v -E -
> cxx @/home/lmeier/test/
> cxx        /usr/local/bin/avr-g++
> mode       -std=c++23 -fmodules-ts
> id         gcc
> version    14.0.0 20230421 (experimental) (GCC)
> major      14
> minor      0
> patch      0
> signature  gcc version 14.0.0 20230421 (experimental) (GCC)
> checksum   78940cfba8437200e76f075785d4991711fdea66363d51d81febd20e42db8742
> target     avr-none (avr-none-none)
> runtime    libgcc
> stdlib     none
> c stdlib   other
> pattern    /usr/local/bin/avr-*
> hdr dirs
> /usr/local/lib/gcc/avr/14.0.0/include/
> /usr/local/lib/gcc/avr/14.0.0/include-fixed/
> /usr/local/avr/include/
> lib dirs
> /usr/local/lib/gcc/avr/14.0.0/
> /usr/local/avr/lib/avr/14.0.0/
> /usr/local/avr/lib/
> b: 
> /home/lmeier/.cache/yay/build2/src/build2-toolchain-0.15.0/build2/libbuild2/cc/guess.cxx:3529: void build2::cc::guess_std_importable_headers(const compiler_info&, const build2::dir_paths&, importable_headers&): Assertion `p != nullptr' failed.
> Abgebrochen (Speicherabzug geschrieben)
> 
> 
> 
> 
> 
>>
>> My guess would be build2 could not extract compiler information (id,
>> version, target, etc). It's not uncommon for embedded toolchains to
>> "customize" things beyond recognition. There is a bunch of configuration
>> variables that allow you to override auto-detected values, from the
>> NEWS file:
>>
>> * New config.{c,cxx}.{id,version,target} configuration variables.
>>
>>    These variables allow overriding guessed compiler 
>> id/version/target, for
>>    example, in case of mis-guesses or when working with compilers that 
>> don't
>>    report their base (e.g., GCC, Clang) with -v/--version (common in the
>>    embedded space).
>>
> 



More information about the users mailing list