Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tricore options to arch list #16317

Merged
merged 8 commits into from
Aug 27, 2024
Merged

Conversation

photex
Copy link
Contributor

@photex photex commented May 22, 2024

Changelog: Feature: Add tricore compiler architecture support.
Docs: conan-io/docs#3819
Docs: conan-io/docs#3851

Close #16318

Hello! I'd like to start the process here in adding support (whatever that might mean) for tricore-gcc. Currently I'm not able to use the settings.arch to specify the actual arch I'm using, and I assume this probably goes a bit deeper than just updating the yaml file.

For the most part I'm building my firmware by hook and by crook without this support. But It would be nice to learn how to do things properly.

Unlike some other proprietary toolchains that target Aurix devices, tricore-gcc can be built yourself: https://github.com/EEESlab/tricore-gcc-toolchain-11.3.0

I already have a Conan package for this which I'm using, but it's held together with duct-tape and wishful thinking still.

Changelog: Feature: Describe here your pull request
Docs: https://github.com/conan-io/docs/pull/XXXX

@CLAassistant
Copy link

CLAassistant commented May 22, 2024

CLA assistant check
All committers have signed the CLA.

@memsharded
Copy link
Member

Thanks for your contribution @photex

You are right, adding the settings is the first thing. But I also think that it would be good to have at least a check that it works for at least the basic CMake integration:

  • we can assume the compiler is in the system, no need to have it in a conan package
  • the basic conan new cmake_lib better if used with a dependency like zlib/1.3 should be able to compile with the new settings

@photex
Copy link
Contributor Author

photex commented May 22, 2024

Is there another common library used for testing baremetal toolchains? I haven't tried zlib yet, but Aurix (tricore) is an embedded platform and I don't know if zlib is expected to work there. I'll give it a shot regardless.

@memsharded
Copy link
Member

Is there another common library used for testing baremetal toolchains? I haven't tried zlib yet, but Aurix (tricore) is an embedded platform and I don't know if zlib is expected to work there. I'll give it a shot regardless.

Not really, actually zlib is kind of an ubiquitous library that is likely to be buildable in most of the platforms, and not affected much by architectures or other platform specifics, this is why it is a good candidate for testing things.

@photex
Copy link
Contributor Author

photex commented May 23, 2024

Alrighty, I'm able to build zlib using one of the tricore archs:

Profile used:

[settings]
os=baremetal
arch=tc162
compiler=gcc
compiler.version=11
compiler.cppstd=20
compiler.libcxx=libstdc++11

[options]
# shared=True option only for zlib package
zlib/*:shared=False
zlib/*:fPIC=False

[conf]
tools.cmake.cmaketoolchain:generator=Ninja Multi-Config
tools.build:compiler_executables={"c":"tricore-elf-gcc","cpp":"tricore-elf-g++"}

[buildenv]
CMAKE_TRY_COMPILE_TARGET_TYPE="STATIC_LIBRARY"
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER"
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY="ONLY"
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE="ONLY"
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE="ONLY"
CMAKE_SYSTEM_NAME="baremetal"
CMAKE_SYSTEM_PROCESSOR="tricore"
CMAKE_C_FLAGS="-mtc162"
CMAKE_CXX_FLAGS="-mtc162"
CMAKE_LINKER_FLAGS="-mtc162"

Command line used:

conan install . -pr:h ~aurix_tc377tx -of build -s build_type=Release --build="*"

Output:

(.venv) [chipc@bucket foo]$ conan install . -pr:h ~/workspaces/kvs/profiles/aurix_tc377tx -of build -s build_type=Release --build="*"

======== Input profiles ========
Profile host:
[settings]
arch=tc162
build_type=Release
compiler=gcc
compiler.cppstd=20
compiler.libcxx=libstdc++11
compiler.version=11
os=baremetal
[options]
zlib/*:fPIC=False
zlib/*:shared=False
[conf]
tools.build:compiler_executables={'c': 'tricore-elf-gcc', 'cpp': 'tricore-elf-g++'}
tools.cmake.cmaketoolchain:generator=Ninja Multi-Config
[buildenv]
CMAKE_TRY_COMPILE_TARGET_TYPE="STATIC_LIBRARY"
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER"
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY="ONLY"
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE="ONLY"
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE="ONLY"
CMAKE_SYSTEM_NAME="baremetal"
CMAKE_SYSTEM_PROCESSOR="tricore"
CMAKE_C_FLAGS="-mtc162"
CMAKE_CXX_FLAGS="-mtc162"
CMAKE_LINKER_FLAGS="-mtc162"

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux


======== Computing dependency graph ========
Graph root
    conanfile.py (foo/1.0): /home/chipc/workspaces/conan/foo/conanfile.py
Requirements
    zlib/1.2.13#4e74ebf1361fe6fb60326f473f276eb5 - Cache

======== Computing necessary packages ========
zlib/1.2.13: Forced build from source
Requirements
    zlib/1.2.13#4e74ebf1361fe6fb60326f473f276eb5:09b09ac0f270c2f8bb2a6716c0e57b1983c1682d - Build

======== Installing packages ========

-------- Installing package zlib/1.2.13 (1 of 1) --------
zlib/1.2.13: Building from source
zlib/1.2.13: Package zlib/1.2.13:09b09ac0f270c2f8bb2a6716c0e57b1983c1682d
zlib/1.2.13: Copying sources to build folder
zlib/1.2.13: Building your package in /home/chipc/.conan2/p/b/zlib2bd947a06b8af/b
zlib/1.2.13: Calling generate()
zlib/1.2.13: Generators folder: /home/chipc/.conan2/p/b/zlib2bd947a06b8af/b/build/generators
zlib/1.2.13: CMakeToolchain generated: conan_toolchain.cmake
zlib/1.2.13: CMakeToolchain generated: /home/chipc/.conan2/p/b/zlib2bd947a06b8af/b/build/generators/CMakePresets.json
zlib/1.2.13: CMakeToolchain generated: /home/chipc/.conan2/p/b/zlib2bd947a06b8af/b/src/CMakeUserPresets.json
zlib/1.2.13: Generating aggregated env files
zlib/1.2.13: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
zlib/1.2.13: Calling build()
zlib/1.2.13: Apply patch (conan): separate static/shared builds, disable debug suffix, disable building examples
zlib/1.2.13: Running CMake.configure()
zlib/1.2.13: RUN: cmake -G "Ninja Multi-Config" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/chipc/.conan2/p/b/zlib2bd947a06b8af/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" "/home/chipc/.conan2/p/b/zlib2bd947a06b8af/b/src"
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Using Conan toolchain: /home/chipc/.conan2/p/b/zlib2bd947a06b8af/b/build/generators/conan_toolchain.cmake
-- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=OFF (options.fPIC)
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- The C compiler identification is GNU 11.3.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/chipc/.conan2/p/b/tricoe43a847349e11/p/tricore-elf/bin/tricore-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - failed
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Renaming
--     /home/chipc/.conan2/p/b/zlib2bd947a06b8af/b/src/zconf.h
-- to 'zconf.h.included' because this file is included with zlib
-- but CMake generates it automatically in the build directory.
-- Configuring done (0.6s)
-- Generating done (0.0s)
-- Build files have been written to: /home/chipc/.conan2/p/b/zlib2bd947a06b8af/b/build

zlib/1.2.13: Running CMake.build()
zlib/1.2.13: RUN: cmake --build "/home/chipc/.conan2/p/b/zlib2bd947a06b8af/b/build" --config Release -- -j24
[16/16] Linking C static library Release/libz.a

zlib/1.2.13: Package '09b09ac0f270c2f8bb2a6716c0e57b1983c1682d' built
zlib/1.2.13: Build folder /home/chipc/.conan2/p/b/zlib2bd947a06b8af/b/build
zlib/1.2.13: Generating the package
zlib/1.2.13: Packaging in folder /home/chipc/.conan2/p/b/zlib2bd947a06b8af/p
zlib/1.2.13: Calling package()
zlib/1.2.13: Running CMake.install()
zlib/1.2.13: RUN: cmake --install "/home/chipc/.conan2/p/b/zlib2bd947a06b8af/b/build" --config Release --prefix "/home/chipc/.conan2/p/b/zlib2bd947a06b8af/p"
-- Installing: /home/chipc/.conan2/p/b/zlib2bd947a06b8af/p/lib/libz.a
-- Installing: /home/chipc/.conan2/p/b/zlib2bd947a06b8af/p/include/zconf.h
-- Installing: /home/chipc/.conan2/p/b/zlib2bd947a06b8af/p/include/zlib.h

zlib/1.2.13: package(): Packaged 1 file: LICENSE
zlib/1.2.13: package(): Packaged 1 '.a' file: libz.a
zlib/1.2.13: package(): Packaged 2 '.h' files: zconf.h, zlib.h
zlib/1.2.13: Created package revision ef1fde8ac197eadbd05b7e60a94d78f0
zlib/1.2.13: Package '09b09ac0f270c2f8bb2a6716c0e57b1983c1682d' created
zlib/1.2.13: Full package reference: zlib/1.2.13#4e74ebf1361fe6fb60326f473f276eb5:09b09ac0f270c2f8bb2a6716c0e57b1983c1682d#ef1fde8ac197eadbd05b7e60a94d78f0
zlib/1.2.13: Package folder /home/chipc/.conan2/p/b/zlib2bd947a06b8af/p
WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X:
WARN: deprecated:     'cpp_info.names' used in: zlib/1.2.13

======== Finalizing install (deploy, generators) ========
conanfile.py (foo/1.0): Calling generate()
conanfile.py (foo/1.0): Generators folder: /home/chipc/workspaces/conan/foo/build
conanfile.py (foo/1.0): Generating aggregated env files
conanfile.py (foo/1.0): Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
Install finished successfully

@memsharded
Copy link
Member

That looks good.
Do you have some way to validate the resulting binary with some tool to check that it actually belongs to that architecture? The output for the compiler in CMake log seems ok with /home/chipc/.conan2/p/b/tricoe43a847349e11/p/tricore-elf/bin/tricore-elf-gcc, validating that the generated binary code belongs to the architecture would be fantastic.

If this works out of the box with the current CMake integration, it would be good enough to be merged in the default settings, and probably add some pointers or minimal guide in the docs.

@photex
Copy link
Contributor Author

photex commented May 23, 2024

Do you have some way to validate the resulting binary with some tool to check that it actually belongs to that architecture

I was just wondering about that. I'll see what I can dig up!

@photex
Copy link
Contributor Author

photex commented May 23, 2024

Ok, this was the best idea I had at the moment:

(.venv) [chipc@bucket foo]$ mkdir libz-objects
(.venv) [chipc@bucket foo]$ cd libz-objects/
(.venv) [chipc@bucket libz-objects]$ ar x /home/chipc/.conan2/p/b/zlib2bd947a06b8af/p/lib/libz.a
(.venv) [chipc@bucket libz-objects]$ ls
adler32.c.obj   crc32.c.obj    gzclose.c.obj  gzread.c.obj   infback.c.obj  inflate.c.obj   trees.c.obj    zutil.c.obj
compress.c.obj  deflate.c.obj  gzlib.c.obj    gzwrite.c.obj  inffast.c.obj  inftrees.c.obj  uncompr.c.obj
(.venv) [chipc@bucket libz-objects]$ file gzlib.c.obj 
gzlib.c.obj: ELF 32-bit LSB relocatable, Siemens Tricore Embedded Processor, version 1 (SYSV), not stripped
(.venv) [chipc@bucket libz-objects]$

@memsharded
Copy link
Member

ELF 32-bit LSB relocatable, Siemens Tricore Embedded Processor, version 1 (SYSV), not stripped

Not bad, but not enough detail about the architecture in particular apparently. Of course running some executable in the actual HW would validate things, are you planning some kind of a full "hello world" full proof of concept involving the real HW?

@photex
Copy link
Contributor Author

photex commented May 23, 2024

That's a good idea. I bet I could adapt the blinky example from https://github.com/Infineon/AURIX_code_examples/tree/master/code_examples/Blinky_LED_1_KIT_TC397_TFT

Qemu might be an option, it has some early tricore support.

@photex
Copy link
Contributor Author

photex commented May 24, 2024

Ok, a hello world project will definitely take me some time that I don't have (for the moment, due to other work priorities). In the meantime though I did realize that I can use tricore-elf-readelf:

(.venv) [chipc@bucket libz-objects]$ tricore-elf-readelf -h deflate.c.obj 
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              REL (Relocatable file)
  Machine:                           Infineon Tricore
  Version:                           0x1
  Entry point address:               0x0
  Start of program headers:          0 (bytes into file)
  Start of section headers:          31168 (bytes into file)
  Flags:                             0x100000, TC1.6.2
  Size of this header:               52 (bytes)
  Size of program headers:           0 (bytes)
  Number of program headers:         0
  Size of section headers:           40 (bytes)
  Number of section headers:         13
  Section header string table index: 12

I've also built my firmware using my branch and updated profiles to include the arch. And I still have to be sure and wiggle the -mtc162 flag in there via my CMake toolchain, for the zlib test it was enough to set the env var CFLAGS. The default for tricore-gcc is to use tc13. Which I can verify by removing the -mtc162 and rebuilding zlib:

(.venv) [chipc@bucket libz-objects]$ ar x /home/chipc/.conan2/p/b/zlib2bd947a06b8af/p/lib/libz.a
(.venv) [chipc@bucket libz-objects]$ tricore-elf-readelf -h deflate.c.obj 
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              REL (Relocatable file)
  Machine:                           Infineon Tricore
  Version:                           0x1
  Entry point address:               0x0
  Start of program headers:          0 (bytes into file)
  Start of section headers:          31452 (bytes into file)
  Flags:                             0x20000000, TC1.3
  Size of this header:               52 (bytes)
  Size of program headers:           0 (bytes)
  Number of program headers:         0
  Size of section headers:           40 (bytes)
  Number of section headers:         13
  Section header string table index: 12

Which makes me wonder whether other arch settings would work the same? For example: armv7hf, is there logic elsewhere in the Conan CMake tools that handle setting the relevant target flags for the toolchain? Or is it expected to be handled by profiles or developers every time?

@photex
Copy link
Contributor Author

photex commented May 24, 2024

Now I see: conan/tools/build/flags.py, will update that and rebuild without injecting the arch flags in the profile.

@photex photex closed this May 24, 2024
@photex
Copy link
Contributor Author

photex commented May 24, 2024

Oh no... I closed on accident. 😬

@memsharded memsharded reopened this May 24, 2024
@memsharded
Copy link
Member

Don't worry, PRs can be re-opened, done :)

Now I see: conan/tools/build/flags.py, will update that and rebuild without injecting the arch flags in the profile.

This is exactly what I was thinking of. Sometimes it is not enough to define the architecture, but some flags or something must be added to the build system integrations, typically in the toolchains (CMakeToolchain, AutotoolsToolchain, MesonToolchain,...), and some of these toolchains might use conan/tools/build/flags.py, for some common functionality so adding it there might help, but this is something to check in different build systems. At the moment given the nature of the compiler, I would focus on autotools and CMake, the others can wait for a second iteration.

@photex
Copy link
Contributor Author

photex commented May 24, 2024

I've pushed the little package I'm using to test with: https://github.com/photex/conan-tricore-test

I've included a test.log there which runs a build for 3 of the architectures and then prints their elf headers afterwards. Each builds and links with zlib using --whole-archive.

It's placed in this separate repo currently because I'm not yet certain how to integrate with the Conan testsuite properly (given that there isn't a toolchain for the arch on conancenter yet).

I have updated the flags, and the cmake toolchain generator.

In the generated conan_toolchain files I see the correct values for the system:

set(CMAKE_SYSTEM_NAME Generic-ELF)
set(CMAKE_SYSTEM_PROCESSOR tricore)

And the arch flags are generated correctly as well. For example:

string(APPEND CONAN_CXX_FLAGS " -mtc131")
string(APPEND CONAN_C_FLAGS " -mtc131")
string(APPEND CONAN_SHARED_LINKER_FLAGS " -mtc131")
string(APPEND CONAN_EXE_LINKER_FLAGS " -mtc131")

photex added 2 commits May 24, 2024 11:35
- Added arch target flags to conan/tools/build/flags.py
- Updated cmake/toolchain/blocks.py to reflect the expected system name and processor
@photex photex force-pushed the dev/chip/tricore-arch branch from a47a58a to a36536d Compare May 24, 2024 09:36
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good, I think it will be possible to merge it as it is low risk.

It would be good to add a couple of "unittest" tests:

If you need help with the tests, just let me know, I can contribute those tests too.

@photex
Copy link
Contributor Author

photex commented May 27, 2024

Thank you @memsharded I'll get those started asap.

@memsharded
Copy link
Member

There were some conflict with recent CMakeToolchain changes, I have tried to fix it. Also updated the first comment to include the Changelog line and reference the issue.

@photex
Copy link
Contributor Author

photex commented Jun 5, 2024

Just checking in real quick: work picked up but I'm still intending to add these unit tests once things cool down.

@memsharded
Copy link
Member

memsharded commented Jun 5, 2024

Just checking in real quick: work picked up but I'm still intending to add these unit tests once things cool down.

Don't worry, no hurries, just let me know when you can do it and we'll have a look and try to help to get this merged.

@photex
Copy link
Contributor Author

photex commented Aug 26, 2024

Just had to jog my memory, the current profiles in my test repo don't use those lines: https://github.com/photex/conan-tricore-test I think I removed those when I switched to Generic-ELF.
The reason for the switch to Generic-ELF is due to the conventional expectation of tricore binaries to have the .elf extension (winIDEA for example gets configured with a *.elf and *.hex)

@photex
Copy link
Contributor Author

photex commented Aug 26, 2024

Output from conan new:

(conan-dev-venv) [chipc@bucket conan-test]$ conan new cmake_lib -d name=mypkg -d version=0.1
Migration: Successfully updated settings.yml
File saved: CMakeLists.txt
File saved: conanfile.py
File saved: include/mypkg.h
File saved: src/mypkg.cpp
File saved: test_package/CMakeLists.txt
File saved: test_package/conanfile.py
File saved: test_package/src/example.cpp

Output of conan create:

(conan-dev-venv) [chipc@bucket conan-test]$ conan create .

======== Exporting recipe to the cache ========
mypkg/0.1: Exporting package recipe: /home/chipc/workspaces/kopernikus/conan-test/conanfile.py
mypkg/0.1: Copied 1 '.py' file: conanfile.py
mypkg/0.1: Copied 1 '.txt' file: CMakeLists.txt
mypkg/0.1: Copied 1 '.cpp' file: mypkg.cpp
mypkg/0.1: Copied 1 '.h' file: mypkg.h
mypkg/0.1: Exported to cache folder: /home/chipc/.conan2/p/mypkga237a5f70f50d/e
mypkg/0.1: Exported: mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92 (2024-08-26 11:15:39 UTC)

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=14
os=Linux

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=14
os=Linux


======== Computing dependency graph ========
Graph root
    cli
Requirements
    mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92 - Cache

======== Computing necessary packages ========
mypkg/0.1: Forced build from source
Requirements
    mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92:ae31f4f7984f94788aa6945a68ab71ea3440d27f - Build

======== Installing packages ========

-------- Installing package mypkg/0.1 (1 of 1) --------
mypkg/0.1: Building from source
mypkg/0.1: Package mypkg/0.1:ae31f4f7984f94788aa6945a68ab71ea3440d27f
mypkg/0.1: Copying sources to build folder
mypkg/0.1: Building your package in /home/chipc/.conan2/p/b/mypkg59e4f112be366/b
mypkg/0.1: Calling generate()
mypkg/0.1: Generators folder: /home/chipc/.conan2/p/b/mypkg59e4f112be366/b/build/Release/generators
mypkg/0.1: CMakeToolchain generated: conan_toolchain.cmake
mypkg/0.1: CMakeToolchain generated: /home/chipc/.conan2/p/b/mypkg59e4f112be366/b/build/Release/generators/CMakePresets.json
mypkg/0.1: CMakeToolchain generated: /home/chipc/.conan2/p/b/mypkg59e4f112be366/b/CMakeUserPresets.json
mypkg/0.1: Generating aggregated env files
mypkg/0.1: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
mypkg/0.1: Calling build()
mypkg/0.1: Running CMake.configure()
mypkg/0.1: RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/chipc/.conan2/p/b/mypkg59e4f112be366/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/home/chipc/.conan2/p/b/mypkg59e4f112be366/b"
-- Using Conan toolchain: /home/chipc/.conan2/p/b/mypkg59e4f112be366/b/build/Release/generators/conan_toolchain.cmake
-- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC)
-- Conan toolchain: Defining architecture flag: -m64
-- Conan toolchain: C++ Standard 17 with extensions ON
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- The CXX compiler identification is GNU 14.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /home/chipc/.conan2/p/b/mypkg59e4f112be366/b/build/Release

mypkg/0.1: Running CMake.build()
mypkg/0.1: RUN: cmake --build "/home/chipc/.conan2/p/b/mypkg59e4f112be366/b/build/Release" -- -j24
[ 50%] Building CXX object CMakeFiles/mypkg.dir/src/mypkg.cpp.o
[100%] Linking CXX static library libmypkg.a
[100%] Built target mypkg

mypkg/0.1: Package 'ae31f4f7984f94788aa6945a68ab71ea3440d27f' built
mypkg/0.1: Build folder /home/chipc/.conan2/p/b/mypkg59e4f112be366/b/build/Release
mypkg/0.1: Generating the package
mypkg/0.1: Packaging in folder /home/chipc/.conan2/p/b/mypkg59e4f112be366/p
mypkg/0.1: Calling package()
mypkg/0.1: Running CMake.install()
mypkg/0.1: RUN: cmake --install "/home/chipc/.conan2/p/b/mypkg59e4f112be366/b/build/Release" --prefix "/home/chipc/.conan2/p/b/mypkg59e4f112be366/p"
-- Install configuration: "Release"
-- Installing: /home/chipc/.conan2/p/b/mypkg59e4f112be366/p/lib/libmypkg.a
-- Installing: /home/chipc/.conan2/p/b/mypkg59e4f112be366/p/include/mypkg.h

mypkg/0.1: package(): Packaged 1 '.a' file: libmypkg.a
mypkg/0.1: package(): Packaged 1 '.h' file: mypkg.h
mypkg/0.1: Created package revision 747d11fc8bf380d3d8688f9f2fffb11f
mypkg/0.1: Package 'ae31f4f7984f94788aa6945a68ab71ea3440d27f' created
mypkg/0.1: Full package reference: mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92:ae31f4f7984f94788aa6945a68ab71ea3440d27f#747d11fc8bf380d3d8688f9f2fffb11f
mypkg/0.1: Package folder /home/chipc/.conan2/p/b/mypkg59e4f112be366/p

======== Launching test_package ========

======== Computing dependency graph ========
Graph root
    mypkg/0.1 (test package): /home/chipc/workspaces/kopernikus/conan-test/test_package/conanfile.py
Requirements
    mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92 - Cache

======== Computing necessary packages ========
Requirements
    mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92:ae31f4f7984f94788aa6945a68ab71ea3440d27f#747d11fc8bf380d3d8688f9f2fffb11f - Cache

======== Installing packages ========
mypkg/0.1: Already installed! (1 of 1)

======== Testing the package ========
Removing previously existing 'test_package' build folder: /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-14-x86_64-gnu17-release
mypkg/0.1 (test package): Test package build: build/gcc-14-x86_64-gnu17-release
mypkg/0.1 (test package): Test package build folder: /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-14-x86_64-gnu17-release
mypkg/0.1 (test package): Writing generators to /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-14-x86_64-gnu17-release/generators
mypkg/0.1 (test package): Generator 'CMakeDeps' calling 'generate()'
mypkg/0.1 (test package): CMakeDeps necessary find_package() and targets for your CMakeLists.txt
    find_package(mypkg)
    target_link_libraries(... mypkg::mypkg)
mypkg/0.1 (test package): Generator 'CMakeToolchain' calling 'generate()'
mypkg/0.1 (test package): CMakeToolchain generated: conan_toolchain.cmake
mypkg/0.1 (test package): CMakeToolchain generated: /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-14-x86_64-gnu17-release/generators/CMakePresets.json
mypkg/0.1 (test package): CMakeToolchain generated: /home/chipc/workspaces/kopernikus/conan-test/test_package/CMakeUserPresets.json
mypkg/0.1 (test package): Generating aggregated env files
mypkg/0.1 (test package): Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']

======== Testing the package: Building ========
mypkg/0.1 (test package): Calling build()
mypkg/0.1 (test package): Running CMake.configure()
mypkg/0.1 (test package): RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/chipc/workspaces/kopernikus/conan-test/test_package" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/home/chipc/workspaces/kopernikus/conan-test/test_package"
-- Using Conan toolchain: /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-14-x86_64-gnu17-release/generators/conan_toolchain.cmake
-- Conan toolchain: Defining architecture flag: -m64
-- Conan toolchain: C++ Standard 17 with extensions ON
-- The CXX compiler identification is GNU 14.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: Target declared 'mypkg::mypkg'
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-14-x86_64-gnu17-release

mypkg/0.1 (test package): Running CMake.build()
mypkg/0.1 (test package): RUN: cmake --build "/home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-14-x86_64-gnu17-release" -- -j24
[ 50%] Building CXX object CMakeFiles/example.dir/src/example.cpp.o
[100%] Linking CXX executable example
[100%] Built target example


======== Testing the package: Executing test ========
mypkg/0.1 (test package): Running test()
mypkg/0.1 (test package): RUN: ./example
mypkg/0.1: Hello World Release!
  mypkg/0.1: __x86_64__ defined
  mypkg/0.1: _GLIBCXX_USE_CXX11_ABI 1
  mypkg/0.1: __cplusplus201703
  mypkg/0.1: __GNUC__14
  mypkg/0.1: __GNUC_MINOR__2
mypkg/0.1 test_package

(conan-dev-venv) [chipc@bucket conan-test]$

Did you need these with my tc16* profiles?

@memsharded
Copy link
Member

Did you need these with my tc16* profiles?

Yes, please, sorry I wasn't explicit about this, with your tricore profiles, thanks! 🙂

@photex
Copy link
Contributor Author

photex commented Aug 26, 2024

Ok, this uses the following build profile:

[settings]
os=baremetal
arch=tc162
compiler=gcc
compiler.version=11
compiler.cppstd=20
compiler.libcxx=libstdc++11

[conf]
tools.build:compiler_executables={"c":"tricore-elf-gcc","cpp":"tricore-elf-g++"}
tools.cmake.cmake_layout:build_folder=build/tc162
tools.cmake.cmaketoolchain:generator=Ninja Multi-Config

# I have to do this, otherwise zlib tries to use fPIC which isn't supported by tricore.
[options]
*:shared=False
*:fPIC=False
(conan-dev-venv) [chipc@bucket conan-test]$ conan new cmake_lib -d name=mypkg -d version=0.1 
File saved: CMakeLists.txt
File saved: conanfile.py
File saved: include/mypkg.h
File saved: src/mypkg.cpp
File saved: test_package/CMakeLists.txt
File saved: test_package/conanfile.py
File saved: test_package/src/example.cpp
(conan-dev-venv) [chipc@bucket conan-test]$ conan create . -pr:b=../conan-tricore-test/profiles/tc162 -s build_type=Release

======== Exporting recipe to the cache ========
mypkg/0.1: Exporting package recipe: /home/chipc/workspaces/kopernikus/conan-test/conanfile.py
mypkg/0.1: Copied 1 '.py' file: conanfile.py
mypkg/0.1: Copied 1 '.txt' file: CMakeLists.txt
mypkg/0.1: Copied 1 '.cpp' file: mypkg.cpp
mypkg/0.1: Copied 1 '.h' file: mypkg.h
mypkg/0.1: Exported to cache folder: /home/chipc/.conan2/p/mypkga237a5f70f50d/e
mypkg/0.1: Exported: mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92 (2024-08-26 11:29:40 UTC)

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=14
os=Linux

Profile build:
[settings]
arch=tc162
compiler=gcc
compiler.cppstd=20
compiler.libcxx=libstdc++11
compiler.version=11
os=baremetal
[options]
*:fPIC=False
*:shared=False
[conf]
tools.build:compiler_executables={'c': 'tricore-elf-gcc', 'cpp': 'tricore-elf-g++'}
tools.cmake.cmake_layout:build_folder=build/tc162
tools.cmake.cmaketoolchain:generator=Ninja Multi-Config


======== Computing dependency graph ========
Graph root
    cli
Requirements
    mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92 - Cache

======== Computing necessary packages ========
mypkg/0.1: Forced build from source
Requirements
    mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92:ae31f4f7984f94788aa6945a68ab71ea3440d27f - Build

======== Installing packages ========

-------- Installing package mypkg/0.1 (1 of 1) --------
mypkg/0.1: Building from source
mypkg/0.1: Package mypkg/0.1:ae31f4f7984f94788aa6945a68ab71ea3440d27f
mypkg/0.1: Copying sources to build folder
mypkg/0.1: Building your package in /home/chipc/.conan2/p/b/mypkg6aaf60b040afd/b
mypkg/0.1: Calling generate()
mypkg/0.1: Generators folder: /home/chipc/.conan2/p/b/mypkg6aaf60b040afd/b/build/Release/generators
mypkg/0.1: CMakeToolchain generated: conan_toolchain.cmake
mypkg/0.1: CMakeToolchain generated: /home/chipc/.conan2/p/b/mypkg6aaf60b040afd/b/build/Release/generators/CMakePresets.json
mypkg/0.1: CMakeToolchain generated: /home/chipc/.conan2/p/b/mypkg6aaf60b040afd/b/CMakeUserPresets.json
mypkg/0.1: Generating aggregated env files
mypkg/0.1: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
mypkg/0.1: Calling build()
mypkg/0.1: Running CMake.configure()
mypkg/0.1: RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/chipc/.conan2/p/b/mypkg6aaf60b040afd/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/home/chipc/.conan2/p/b/mypkg6aaf60b040afd/b"
-- Using Conan toolchain: /home/chipc/.conan2/p/b/mypkg6aaf60b040afd/b/build/Release/generators/conan_toolchain.cmake
-- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC)
-- Conan toolchain: Defining architecture flag: -m64
-- Conan toolchain: C++ Standard 17 with extensions ON
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- The CXX compiler identification is GNU 14.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /home/chipc/.conan2/p/b/mypkg6aaf60b040afd/b/build/Release

mypkg/0.1: Running CMake.build()
mypkg/0.1: RUN: cmake --build "/home/chipc/.conan2/p/b/mypkg6aaf60b040afd/b/build/Release" -- -j24
[ 50%] Building CXX object CMakeFiles/mypkg.dir/src/mypkg.cpp.o
[100%] Linking CXX static library libmypkg.a
[100%] Built target mypkg

mypkg/0.1: Package 'ae31f4f7984f94788aa6945a68ab71ea3440d27f' built
mypkg/0.1: Build folder /home/chipc/.conan2/p/b/mypkg6aaf60b040afd/b/build/Release
mypkg/0.1: Generating the package
mypkg/0.1: Packaging in folder /home/chipc/.conan2/p/b/mypkg6aaf60b040afd/p
mypkg/0.1: Calling package()
mypkg/0.1: Running CMake.install()
mypkg/0.1: RUN: cmake --install "/home/chipc/.conan2/p/b/mypkg6aaf60b040afd/b/build/Release" --prefix "/home/chipc/.conan2/p/b/mypkg6aaf60b040afd/p"
-- Install configuration: "Release"
-- Installing: /home/chipc/.conan2/p/b/mypkg6aaf60b040afd/p/lib/libmypkg.a
-- Installing: /home/chipc/.conan2/p/b/mypkg6aaf60b040afd/p/include/mypkg.h

mypkg/0.1: package(): Packaged 1 '.a' file: libmypkg.a
mypkg/0.1: package(): Packaged 1 '.h' file: mypkg.h
mypkg/0.1: Created package revision 6f5b6a5a5438d2938a62534cc401b4ae
mypkg/0.1: Package 'ae31f4f7984f94788aa6945a68ab71ea3440d27f' created
mypkg/0.1: Full package reference: mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92:ae31f4f7984f94788aa6945a68ab71ea3440d27f#6f5b6a5a5438d2938a62534cc401b4ae
mypkg/0.1: Package folder /home/chipc/.conan2/p/b/mypkg6aaf60b040afd/p

======== Launching test_package ========

======== Computing dependency graph ========
Graph root
    mypkg/0.1 (test package): /home/chipc/workspaces/kopernikus/conan-test/test_package/conanfile.py
Requirements
    mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92 - Cache

======== Computing necessary packages ========
Requirements
    mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92:ae31f4f7984f94788aa6945a68ab71ea3440d27f#6f5b6a5a5438d2938a62534cc401b4ae - Cache

======== Installing packages ========
mypkg/0.1: Already installed! (1 of 1)

======== Testing the package ========
Removing previously existing 'test_package' build folder: /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-14-x86_64-gnu17-release
mypkg/0.1 (test package): Test package build: build/gcc-14-x86_64-gnu17-release
mypkg/0.1 (test package): Test package build folder: /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-14-x86_64-gnu17-release
mypkg/0.1 (test package): Writing generators to /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-14-x86_64-gnu17-release/generators
mypkg/0.1 (test package): Generator 'CMakeDeps' calling 'generate()'
mypkg/0.1 (test package): CMakeDeps necessary find_package() and targets for your CMakeLists.txt
    find_package(mypkg)
    target_link_libraries(... mypkg::mypkg)
mypkg/0.1 (test package): Generator 'CMakeToolchain' calling 'generate()'
mypkg/0.1 (test package): CMakeToolchain generated: conan_toolchain.cmake
mypkg/0.1 (test package): CMakeToolchain generated: /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-14-x86_64-gnu17-release/generators/CMakePresets.json
mypkg/0.1 (test package): CMakeToolchain generated: /home/chipc/workspaces/kopernikus/conan-test/test_package/CMakeUserPresets.json
mypkg/0.1 (test package): Generating aggregated env files
mypkg/0.1 (test package): Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']

======== Testing the package: Building ========
mypkg/0.1 (test package): Calling build()
mypkg/0.1 (test package): Running CMake.configure()
mypkg/0.1 (test package): RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/chipc/workspaces/kopernikus/conan-test/test_package" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/home/chipc/workspaces/kopernikus/conan-test/test_package"
-- Using Conan toolchain: /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-14-x86_64-gnu17-release/generators/conan_toolchain.cmake
-- Conan toolchain: Defining architecture flag: -m64
-- Conan toolchain: C++ Standard 17 with extensions ON
-- The CXX compiler identification is GNU 14.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: Target declared 'mypkg::mypkg'
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-14-x86_64-gnu17-release

mypkg/0.1 (test package): Running CMake.build()
mypkg/0.1 (test package): RUN: cmake --build "/home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-14-x86_64-gnu17-release" -- -j24
[ 50%] Building CXX object CMakeFiles/example.dir/src/example.cpp.o
[100%] Linking CXX executable example
[100%] Built target example


======== Testing the package: Executing test ========
mypkg/0.1 (test package): Running test()

@memsharded
Copy link
Member

I have one concern in the output logs:

-- Conan toolchain: Defining architecture flag: -m64

It seems the right flag is not being defined?
Can you please check the generated conan_toolchain.cmake file? You have the full path:

Using Conan toolchain: /home/chipc/.conan2/p/b/mypkg6aaf60b040afd/b/build/Release/generators/conan_toolchain.cmake

And see what it has as flags there?

@memsharded
Copy link
Member

memsharded commented Aug 26, 2024

It seems the reason is that you swapped the profiles, the Profile build should be the "host" one and vice versa, isn't it?

Use instead:

 conan create . -pr=../conan-tricore-test/profiles/tc162 -s build_type=Release

@photex
Copy link
Contributor Author

photex commented Aug 26, 2024

Hrm yeah, in my script in the test repo I'm using -pr:h... and I did switch it here because it was trying to build and link the tests, which won't work without a linker script to setup the exception tables and stuff...
I'll re-run it as suggested.

@photex
Copy link
Contributor Author

photex commented Aug 26, 2024

Here we go, this looks better (test still won't link as is however):

(conan-dev-venv) [chipc@bucket conan-test]$ conan new cmake_lib -d name=mypkg -d version=0.1 
File saved: CMakeLists.txt
File saved: conanfile.py
File saved: include/mypkg.h
File saved: src/mypkg.cpp
File saved: test_package/CMakeLists.txt
File saved: test_package/conanfile.py
File saved: test_package/src/example.cpp
(conan-dev-venv) [chipc@bucket conan-test]$ conan create . -pr=../conan-tricore-test/profiles/tc162 -s build_type=Release

======== Exporting recipe to the cache ========
mypkg/0.1: Exporting package recipe: /home/chipc/workspaces/kopernikus/conan-test/conanfile.py
mypkg/0.1: Copied 1 '.py' file: conanfile.py
mypkg/0.1: Copied 1 '.txt' file: CMakeLists.txt
mypkg/0.1: Copied 1 '.cpp' file: mypkg.cpp
mypkg/0.1: Copied 1 '.h' file: mypkg.h
mypkg/0.1: Exported to cache folder: /home/chipc/.conan2/p/mypkga237a5f70f50d/e
mypkg/0.1: Exported: mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92 (2024-08-26 12:04:05 UTC)

======== Input profiles ========
Profile host:
[settings]
arch=tc162
build_type=Release
compiler=gcc
compiler.cppstd=20
compiler.libcxx=libstdc++11
compiler.version=11
os=baremetal
[options]
*:fPIC=False
*:shared=False
[conf]
tools.build:compiler_executables={'c': 'tricore-elf-gcc', 'cpp': 'tricore-elf-g++'}
tools.cmake.cmake_layout:build_folder=build/tc162
tools.cmake.cmaketoolchain:generator=Ninja Multi-Config

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=14
os=Linux


======== Computing dependency graph ========
Graph root
    cli
Requirements
    mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92 - Cache

======== Computing necessary packages ========
mypkg/0.1: Forced build from source
Requirements
    mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92:6eb687cbc101cbed9eb04560489c29c4f63e34ba - Build

======== Installing packages ========

-------- Installing package mypkg/0.1 (1 of 1) --------
mypkg/0.1: Building from source
mypkg/0.1: Package mypkg/0.1:6eb687cbc101cbed9eb04560489c29c4f63e34ba
mypkg/0.1: Copying sources to build folder
mypkg/0.1: Building your package in /home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/b
mypkg/0.1: Calling generate()
mypkg/0.1: Generators folder: /home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/b/build/generators
mypkg/0.1: CMakeToolchain generated: conan_toolchain.cmake
mypkg/0.1: CMakeToolchain generated: /home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/b/build/generators/CMakePresets.json
mypkg/0.1: CMakeToolchain generated: /home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/b/CMakeUserPresets.json
mypkg/0.1: Generating aggregated env files
mypkg/0.1: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
mypkg/0.1: Calling build()
mypkg/0.1: Running CMake.configure()
mypkg/0.1: RUN: cmake -G "Ninja Multi-Config" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" "/home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/b"
-- Using Conan toolchain: /home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/b/build/generators/conan_toolchain.cmake
-- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=OFF (options.fPIC)
-- Conan toolchain: Defining architecture flag: -mtc162
-- Conan toolchain: C++ Standard 20 with extensions OFF
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- The CXX compiler identification is GNU 11.3.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/tricore-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/b/build

mypkg/0.1: Running CMake.build()
mypkg/0.1: RUN: cmake --build "/home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/b/build" --config Release -- -j24
[2/2] Linking CXX static library Release/libmypkg.a

mypkg/0.1: Package '6eb687cbc101cbed9eb04560489c29c4f63e34ba' built
mypkg/0.1: Build folder /home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/b/build
mypkg/0.1: Generating the package
mypkg/0.1: Packaging in folder /home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/p
mypkg/0.1: Calling package()
mypkg/0.1: Running CMake.install()
mypkg/0.1: RUN: cmake --install "/home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/b/build" --config Release --prefix "/home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/p"
-- Installing: /home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/p/lib/libmypkg.a
-- Installing: /home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/p/include/mypkg.h

mypkg/0.1: package(): Packaged 1 '.a' file: libmypkg.a
mypkg/0.1: package(): Packaged 1 '.h' file: mypkg.h
mypkg/0.1: Created package revision a6657ff9bfe889b8b429a43494b94eb8
mypkg/0.1: Package '6eb687cbc101cbed9eb04560489c29c4f63e34ba' created
mypkg/0.1: Full package reference: mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92:6eb687cbc101cbed9eb04560489c29c4f63e34ba#a6657ff9bfe889b8b429a43494b94eb8
mypkg/0.1: Package folder /home/chipc/.conan2/p/b/mypkg6f37a20c93bc6/p

======== Launching test_package ========

======== Computing dependency graph ========
Graph root
    mypkg/0.1 (test package): /home/chipc/workspaces/kopernikus/conan-test/test_package/conanfile.py
Requirements
    mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92 - Cache

======== Computing necessary packages ========
Requirements
    mypkg/0.1#69dcbff05d037a4e961ce5a029a6ed92:6eb687cbc101cbed9eb04560489c29c4f63e34ba#a6657ff9bfe889b8b429a43494b94eb8 - Cache

======== Installing packages ========
mypkg/0.1: Already installed! (1 of 1)

======== Testing the package ========
Removing previously existing 'test_package' build folder: /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-11-tc162-20-release
mypkg/0.1 (test package): Test package build: build/gcc-11-tc162-20-release
mypkg/0.1 (test package): Test package build folder: /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-11-tc162-20-release
mypkg/0.1 (test package): Writing generators to /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-11-tc162-20-release/generators
mypkg/0.1 (test package): Generator 'CMakeDeps' calling 'generate()'
mypkg/0.1 (test package): CMakeDeps necessary find_package() and targets for your CMakeLists.txt
    find_package(mypkg)
    target_link_libraries(... mypkg::mypkg)
mypkg/0.1 (test package): Generator 'CMakeToolchain' calling 'generate()'
mypkg/0.1 (test package): CMakeToolchain generated: conan_toolchain.cmake
mypkg/0.1 (test package): CMakeToolchain generated: /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-11-tc162-20-release/generators/CMakePresets.json
mypkg/0.1 (test package): CMakeToolchain generated: /home/chipc/workspaces/kopernikus/conan-test/test_package/CMakeUserPresets.json
mypkg/0.1 (test package): Generating aggregated env files
mypkg/0.1 (test package): Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']

======== Testing the package: Building ========
mypkg/0.1 (test package): Calling build()
mypkg/0.1 (test package): Running CMake.configure()
mypkg/0.1 (test package): RUN: cmake -G "Ninja Multi-Config" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/chipc/workspaces/kopernikus/conan-test/test_package" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" "/home/chipc/workspaces/kopernikus/conan-test/test_package"
-- Using Conan toolchain: /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-11-tc162-20-release/generators/conan_toolchain.cmake
-- Conan toolchain: Defining architecture flag: -mtc162
-- Conan toolchain: C++ Standard 20 with extensions OFF
-- The CXX compiler identification is GNU 11.3.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/tricore-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: Target declared 'mypkg::mypkg'
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-11-tc162-20-release

mypkg/0.1 (test package): Running CMake.build()
mypkg/0.1 (test package): RUN: cmake --build "/home/chipc/workspaces/kopernikus/conan-test/test_package/build/gcc-11-tc162-20-release" --config Release -- -j24
[2/2] Linking CXX executable Release/example.elf
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in CMakeFiles/example.dir/Release/src/example.cpp.obj(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(eh_personality.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(eh_terminate.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(vterminate.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(ios_init.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(locale.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(locale_init.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(monetary_members.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(monetary_members_cow.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(numeric_members.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(numeric_members_cow.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(cow-locale_init.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(cow-shim_facets.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(cow-string-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(cow-wstring-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(ctype.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(ctype_members.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(cxx11-locale-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(cxx11-shim_facets.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(cxx11-wlocale-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(ext11-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(fstream-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(functexcept.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(ios-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(ios.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(iostream-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(istream-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(locale-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(ostream-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(random.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(streambuf-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(string-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(wlocale-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(wstring-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(new_opvnt.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(basic_file.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(codecvt.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(codecvt_members.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(istream.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(misc-inst.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(stdexcept.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(time_members.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(cow-stdexcept.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(cxx11-ios_failure.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(cxx11-stdexcept.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(sso_string.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(system_error.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(compatibility.o)(.gcc_except_table); no .eh_frame_hdr table will be created
/home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/bin/ld: error in /home/chipc/.conan2/p/trico25e03227a3ae7/p/tricore-elf/bin/../lib/gcc/tricore-elf/11.3.1/../../../../tricore-elf/lib/tc162/libstdc++.a(ios_failure.o)(.gcc_except_table); no .eh_frame_hdr table will be created


======== Testing the package: Executing test ========
mypkg/0.1 (test package): Running test()

@photex
Copy link
Contributor Author

photex commented Aug 26, 2024

Generated toolchain looks correct now too:

########## 'arch_flags' block #############
# Define C++ flags, C flags and linker flags from 'settings.arch'

message(STATUS "Conan toolchain: Defining architecture flag: -mtc162")
string(APPEND CONAN_CXX_FLAGS " -mtc162")
string(APPEND CONAN_C_FLAGS " -mtc162")
string(APPEND CONAN_SHARED_LINKER_FLAGS " -mtc162")
string(APPEND CONAN_EXE_LINKER_FLAGS " -mtc162")

@memsharded
Copy link
Member

Thanks for the feedback!

test still won't link as is however

But why? What is it missing for this to link correctly? I think we should be able to correctly build the executable .elf with those commands and the right profile.

@photex
Copy link
Contributor Author

photex commented Aug 26, 2024

The test wants to enable exceptions, but you'd have to provide a linker script to set that up if I'm understanding this correctly.

Maybe disabling exceptions would be ok?

@photex
Copy link
Contributor Author

photex commented Aug 26, 2024

Relevant section of my firmwares linker script:

/*
     * C++ exception handling tables.  NOTE: gcc emits .eh_frame
     * sections when compiling C sources with debugging enabled (-g).
     * If you can be sure that your final application consists
     * exclusively of C objects (i.e., no C++ objects), you may use
     * the -R option of the "strip" and "objcopy" utilities to remove
     * the .eh_frame section from the executable.
     */
    .eh_frame_hdr :
    {
        *(.eh_frame_hdr)
    } > default_rom

    .eh_frame  :
    {
        __EH_FRAME_BEGIN__ = . ;
        KEEP (*(.eh_frame))
        __EH_FRAME_END__ = . ;
        . = ALIGN(8);
    } > default_rom

    .gcc_except_table  :
    {
        __GCC_EXCEPT_TABLE_BEGIN__ = . ;
        KEEP (*(.gcc_except_table))
        __GCC_EXCEPT_TABLE_END__ = . ;
        . = ALIGN(8);
    } > default_rom

@memsharded
Copy link
Member

The test wants to enable exceptions, but you'd have to provide a linker script to set that up if I'm understanding this correctly.

I think we should have kind of "default" setup that is relatively straightforward and can build such library packages and consume them to form an executable, in a kind of "built-in" way. Having to manually provide a linker script seems a bit too manual. Is this linker script something quite standard that Conan should/could provide?

Maybe disabling exceptions would be ok?

Is disabling exceptions kind of "default" or at least the "most popular" approach when building tricore libraries and executables? If that is the case, maybe yes, we could disable exceptions.

Ideally the "onboarding experience" of using tricore compiler should be as straightforward as possible, this is why I was focusing on the conan new + conan create -pr=mytricoreprofile flow. If there is something else that Conan could provide to make this flow work, that would be great to know.

@photex
Copy link
Contributor Author

photex commented Aug 26, 2024

The linker script is specific to your target board and tricore chip. We could provide a default using one of the devkit scripts that are openly available possibly. For example: https://github.com/Infineon/AURIX_code_examples/blob/master/code_examples/SMU_Reset_Alarm_1_KIT_TC375_LK/Lcf_Tasking_Tricore_Tc.lsl

NM: that's a script for the Tasking compiler not GCC. But I think there are some for tricore-gcc available.

@photex
Copy link
Contributor Author

photex commented Aug 26, 2024

Sorry, I misread the question. No you wouldn't provide a linker script to compile a library. This only applies to the test executable.

@memsharded
Copy link
Member

Sorry, I misread the question. No you wouldn't provide a linker script to compile a library. This only applies to the test executable.

Yes, but I think the default functionality should probably also allow to link executables, that is, if I did a:

# this is a template for an executable, not a library
conan new cmake_exe -d name=my_tc_app -d version=0.1

should I be able to do a conan create . -pr=my_tricore_profile (or conan build . -pr=my_tricore_profile, for this case is the same) and get the my_tc_app.elf application built?

I don't know about the tricore ecosystem, but I would expect that somehow the toolchain can be kind of automatically defined in someway. What would be the way to inject/define those linker scripts in the build, so the applications also link?

@photex
Copy link
Contributor Author

photex commented Aug 26, 2024

Tricore-gcc certainly doesn’t have a default linker script in the sources I built from.

For the commercial versions (Hitec) perhaps but I still doubt it.

The pattern of use is largely that they provide an eclipse spin that will stamp out a linker script for your targets and generate makefiles etc.

Once you leave that you’re on your own.

But this is more or less the same for Armv7 isn’t it? I’ve had to provide a linker script for my SK344 chips (or one was provided by zephyr or nuttx for a common devkit).

In any case, I could specify the linker script in the profile right? It’s gcc so -Tfoo.ld is all I’m doing but I set it up with cmake at the moment.

@photex
Copy link
Contributor Author

photex commented Aug 26, 2024

One catch is that the test target would have to define some conventional entry points for tricore.

Normally Core0_Main, Core1_Main, … CoreN_Main.

I number of things tend to be setup using Infineons iLLD library so I’m still not sure you can link an elf for tricore without some extra steps.

@memsharded
Copy link
Member

In any case, I could specify the linker script in the profile right? It’s gcc so -Tfoo.ld is all I’m doing but I set it up with cmake at the moment.

I think this is a good hint: you are doing it in your CMakeLists.txt, but obviously the default CMakeLists.txt of the conan new cmake_exe doesn't contain this. I was wondering if this that you are doing in your CMakeLists.txt can be done somehow in the profile, either injecting a user_toolchain, directly defining some variable with extra_variables... there are mechanisms for this. Maybe this is not as much for this PR, because we are not adding tricore compiler to CI, but for the documentation (or maybe a blog post) having a full working example is very important.

One catch is that the test target would have to define some conventional entry points for tricore.
Normally Core0_Main, Core1_Main, … CoreN_Main.
I number of things tend to be setup using Infineons iLLD library so I’m still not sure you can link an elf for tricore without some extra steps.

Yes, that is fine, there can be extra steps or things to do. I am just trying to learn what are those, and how they could be defined in Conan mechanisms, for the documentation.

@memsharded
Copy link
Member

We are closing the 2.7.0 release now, I will merge this anyway because it is good even if I don't know those details yet, and we can complete the documentation later if necessary.

@photex
Copy link
Contributor Author

photex commented Aug 27, 2024

Thank you for all the help with this. I have the test repo, and I am happy to modify this to have the linker script defined by the profile. In fact, my goal is to leverage conan for as much as we can for our firmware build.

The iLLD library is release under the Boost Software License, so my hope is to actually provide packages for some devkits (I have a couple to test with). They release several variations for specific chips.

Same for the tricore-gcc toolchain which is GPL. Currently we've built this by hand and created a basic internal conan package to provide it, but it would be great to make that a proper package.

@memsharded
Copy link
Member

memsharded commented Aug 27, 2024

Thank you for all the help with this. I have the test repo, and I am happy to modify this to have the linker script defined by the profile. In fact, my goal is to leverage conan for as much as we can for our firmware build.

Sounds good.
Do you think that you could help with the docs? (see the Docs: TODO) there.
I think I can add basics example with cmake_lib, leave a note open warning about cmake_exe and the linker, and if you can complete that later with the instructions how to make it work, that would be great.

The iLLD library is release under the Boost Software License, so my hope is to actually provide packages for some devkits (I have a couple to test with). They release several variations for specific chips.

Same for the tricore-gcc toolchain which is GPL. Currently we've built this by hand and created a basic internal conan package to provide it, but it would be great to make that a proper package.

Sounds good, we might have a place that could be good to share toolchain and other special recipes that might not be great for ConanCenter, please open a new ticket if you would like to share some of this later down the road, and we will guide you. Many thanks!

@czoido czoido merged commit 96d2d98 into conan-io:develop2 Aug 27, 2024
2 checks passed
@photex
Copy link
Contributor Author

photex commented Aug 27, 2024

Sounds good. Do you think that you could help with the docs? (see the Docs: TODO) there. I think I can add basics example with cmake_lib, leave a note open warning about cmake_exe and the linker, and if you can complete that later with the instructions how to make it work, that would be great.

I would be happy to help with the docs.

Sounds good, we might have a place that could be good to share toolchain and other special recipes that might not be great for ConanCenter, please open a new ticket if you would like to share some of this later down the road, and we will guide you. Many thanks!

That's great. My first step will be to convert our internal package to properly package the toolchain. I need to refer to some other toolchain packages for this I think. Currently I just scoop up the binaries I have built and copy them.

@memsharded
Copy link
Member

I have added PR to the docs in conan-io/docs#3819 with some very basic and introductory example, leaving the cmake_exe case for later.

If you could please review it and see if it is correct, for the 2.7 release, feel free to fix, suggest or complete whatever you feel. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] [question] Support the Tricore-gcc toolchain and arch
4 participants