From 350225d6cf919bff5c6db104d980abd695b141fa Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Fri, 22 Nov 2024 11:43:21 -0500 Subject: [PATCH] ansible: cross-compilers find source gcc version via dpkg Change-Id: I828a012e7fef1fdaf0bf4e7a0afe6a3eacb53787 Signed-off-by: Kienan Stewart --- .../ansible/roles/cross-compilers/tasks/setup-Debian.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/automation/ansible/roles/cross-compilers/tasks/setup-Debian.yml b/automation/ansible/roles/cross-compilers/tasks/setup-Debian.yml index 95add22..99d8445 100644 --- a/automation/ansible/roles/cross-compilers/tasks/setup-Debian.yml +++ b/automation/ansible/roles/cross-compilers/tasks/setup-Debian.yml @@ -25,9 +25,12 @@ block: # This step needs to happen after the cross compiler packages are installed # so the libgcc cross libraries can be copied + - ansible.builtin.shell: + cmd: "dpkg -l | grep -E '^ii[ ]+gcc-[0-9]+-cross-base[^-:]' | tr -s ' ' | cut -d ' ' -f 2 | cut -d '-' -f 2 | sort -n | tail -n 1" + register: gcc_cross_major_version - name: Copy gcc-cross libs ansible.builtin.command: - argv: ['cp', '-r', "/usr/lib/gcc-cross/{{item}}/12/", "/usr/lib/gcc-cross/{{item}}/4.8.5"] + argv: ['cp', '-r', "/usr/lib/gcc-cross/{{item}}/{{gcc_cross_major_version.stdout | trim}}/", "/usr/lib/gcc-cross/{{item}}/4.8.5"] creates: "/usr/lib/gcc-cross/{{item}}/4.8.5" with_items: - aarch64-linux-gnu -- 2.39.5