Skip to content

Commit

Permalink
use more direct logic for avoiding superfluous symlinks in libgcc output
Browse files Browse the repository at this point in the history
These symlinks should go into `gcc_impl_{{ cross_target_platform }}`,
so we need to delete them in libgcc-devel, which gets built first.

The more elegant
```
find ${PREFIX}/${CHOST}/lib ! -name libgcc_s.so* -type l -or -type f -exec rm -f '{}' +
```
should only delete libs and files NOT named like libgcc_s.so.*,
but somehow ends up deleting the base folder, leading to:
```
find: ‘${PREFIX}/${CHOST}/lib’: No such file or directory
```
  • Loading branch information
h-vetinari committed Nov 1, 2023
1 parent 176c211 commit a21b09f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions recipe/install-libgcc-devel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ pushd ${SRC_DIR}/build

make -C ${CHOST}/libgcc prefix=${PREFIX} install

# These go into libgcc output
# These go into libgcc-ng output
rm -rf ${PREFIX}/lib/libgcc_s.so*
# These go into gcc_impl
find ${PREFIX}/${CHOST}/lib/ ! -name 'libgcc_s.so*' -type l -or -type f -exec rm -f {} +
# Everything _except_ libgcc_s.so* in ${PREFIX}/${CHOST}/lib/ goes into gcc_impl
mkdir ${PREFIX}/${CHOST}/lib2
cp ${PREFIX}/${CHOST}/lib/libgcc_s.so* ${PREFIX}/${CHOST}/lib2
rm -rf ${PREFIX}/${CHOST}/lib
mv ${PREFIX}/${CHOST}/lib2 ${PREFIX}/${CHOST}/lib
# This is in gcc_impl as it is gcc specific and clang has the same header
rm -rf ${PREFIX}/lib/gcc/${CHOST}/${gcc_version}/include/unwind.h

Expand Down
1 change: 1 addition & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ outputs:
- sysroot_{{ cross_target_platform }} {{ glibc_version }}
host:
- sysroot_{{ cross_target_platform }} {{ glibc_version }}
- {{ pin_subpackage("libgcc-devel_" ~ cross_target_platform, exact=True) }}
- {{ pin_subpackage("libgomp", exact=True) }} # [target_platform == cross_target_platform]
- {{ pin_subpackage("libstdcxx-ng", exact=True) }} # [target_platform == cross_target_platform]
- {{ pin_subpackage("libgcc-ng", exact=True) }} # [target_platform == cross_target_platform]
Expand Down

0 comments on commit a21b09f

Please sign in to comment.