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

sysroot: fix missing symlinks for blas and lapack [IO-60] #25

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 24 additions & 40 deletions sysroot/sysroot-creator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -361,45 +361,29 @@ StripChecksumsFromPackageList() {
HacksAndPatches() {
Banner "Misc Hacks & Patches"

# Remove an unnecessary dependency on qtchooser.
# rm "${INSTALL_ROOT}/usr/lib/${TRIPLE}/qt-default/qtchooser/default.conf"

# libxcomposite1 is missing a symbols file.
# cp "${SCRIPT_DIR}/libxcomposite1-symbols" \
# "${INSTALL_ROOT}/debian/libxcomposite1/DEBIAN/symbols"

# __GLIBC_MINOR__ is used as a feature test macro. Replace it with the
# earliest supported version of glibc (2.26, obtained from the oldest glibc
# version in //chrome/installer/linux/debian/dist_packag_versions.json and
# //chrome/installer/linux/rpm/dist_package_provides.json).
local usr_include="${INSTALL_ROOT}/usr/include"
# local features_h="${usr_include}/features.h"
# sed -i 's|\(#define\s\+__GLIBC_MINOR__\)|\1 26 //|' "${features_h}"

# fcntl64() was introduced in glibc 2.28. Make sure to use fcntl() instead.
# local fcntl_h="${INSTALL_ROOT}/usr/include/fcntl.h"
# sed -i '{N; s/#ifndef __USE_FILE_OFFSET64\(\nextern int fcntl\)/#if 1\1/}' \
# "${fcntl_h}"

# Do not use pthread_cond_clockwait as it was introduced in glibc 2.30.
local cppconfig_h="${usr_include}/${TRIPLE}/c++/10/bits/c++config.h"
sed -i 's|\(#define\s\+_GLIBCXX_USE_PTHREAD_COND_CLOCKWAIT\)|// \1|' \
"${cppconfig_h}"

# This is for chrome's ./build/linux/pkg-config-wrapper
# which overwrites PKG_CONFIG_LIBDIR internally
SubBanner "Move pkgconfig scripts"
mkdir -p ${INSTALL_ROOT}/usr/lib/pkgconfig
mv ${INSTALL_ROOT}/usr/lib/${TRIPLE}/pkgconfig/* \
${INSTALL_ROOT}/usr/lib/pkgconfig

# Avoid requiring unsupported glibc versions.
"${SCRIPT_DIR}/reversion_glibc.py" \
"${INSTALL_ROOT}/lib/${TRIPLE}/libc.so.6"
"${SCRIPT_DIR}/reversion_glibc.py" \
"${INSTALL_ROOT}/lib/${TRIPLE}/libm.so.6"
# "${SCRIPT_DIR}/reversion_glibc.py" \
# "${INSTALL_ROOT}/lib/${TRIPLE}/libcrypt.so.1"
# In debian blas and lapack are virtual packages.
#
# As such - the alternatives system is responsible for ensuring that a
# libblas.so and liblapack.so are available in /usr/lib/${TRIPLE} -
# i.e. - they are in the linkers default search path.
#
# The implementation we're using here - libblas-dev, and liblapack-dev
# only install the libraries to /usr/lib/${TRIPLE}/blas and /usr/lib/${TRIPLE}/lapack
# which are not on the linkers default search paths.
#
# Typically the symlink creation is handled by their respective post install
# scripts - but since we're using dpkg-deb directly - we need to do it ourselves.
#
# Otherwise we have to hardcode the install locations in the build system.
# Dealing with the possible combinations of arch, os, whether we're building
# with a sysroot or not, etc... is too much to keep straight. So we'll deal
# with it here.
cd ${INSTALL_ROOT}/usr/lib/${TRIPLE}
ln -s ./blas/libblas.so libblas.so
ln -s ./blas/libblas.a libblas.a
ln -s ./lapack/liblapack.so liblapack.so
ln -s ./lapack/liblapack.a liblapack.a
cd -
}

InstallIntoSysroot() {
Expand Down Expand Up @@ -528,7 +512,7 @@ BuildSysroot() {
local files_and_sha256sums="$(cat ${package_file})"
StripChecksumsFromPackageList "$package_file"
InstallIntoSysroot ${files_and_sha256sums}
# HacksAndPatches
HacksAndPatches
# CleanupJailSymlinks
# VerifyLibraryDeps
CreateTarBall
Expand Down
Loading