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

Figure out a better way to deal with multilib paths #1

Open
alexrp opened this issue Jul 3, 2024 · 0 comments
Open

Figure out a better way to deal with multilib paths #1

alexrp opened this issue Jul 3, 2024 · 0 comments
Labels
area: build Issues related to the build system. state: deliberation Issues that require design work and/or discussion.

Comments

@alexrp
Copy link
Member

alexrp commented Jul 3, 2024

kruco/bld/tools/gcc.mk

Lines 33 to 50 in f25c824

build-gcc$(1): build-$(2)
> $(Q)$(call cd_pkg,gcc) && $(RM) -f -r build && $(MKDIR) build
> $(Q)$(call cd_pkg,gcc) && cd build && ../configure \
$(gcc_flags) $(gcc_kernel_flags) $(gcc_libc_flags) $(gcc_target_flags) \
$(gcc$(1)_flags) $(gcc$(1)_kernel_flags) $(gcc$(1)_libc_flags) $(gcc$(1)_target_flags)
> $(Q)$(call cd_pkg,gcc) && cd build && $(make_j) $(3)
# GCC insists on multilib directory names for some targets even when
# multilib is disabled. Work around that. See also the similar glibc hack.
#
# TODO: Find a better way to disable multilib paths.
> $(Q)$(call cd_pkg,gcc) && cd build/$(target) && \
$(FIND) -type f \( -name Makefile -or -name '*.py' -or -name '*.la*' \) \
-exec $(SED) 's%$(sysroot)/usr/lib/\.\./lib..*%$(sysroot)/usr/lib%g' '{}' -i \;
> $(Q)$(call cd_pkg,gcc) && cd build/$(target) && \
$(FIND) -type f -name Makefile \
-exec $(SED) 's%\(MULTI\(OS\)\{0,1\}DIR\) := .*%\1 := \.%g' '{}' -i \;
> $(Q)$(call cd_pkg,gcc) && cd build && $(make_j) $(4)
endef

kruco/bld/libc/glibc.mk

Lines 12 to 30 in f25c824

# We do not build multilib toolchains, and so glibc's insistence on putting
# libraries in multilib directories like /lib64 on some platforms causes all
# sorts of breakage (e.g. failure to find crti.o when linking libgcc for stage-2
# GCC).
#
# TODO: Find a better way to disable multilib paths.
slibdir_hack = libc_cv_slibdir=/lib
build-libc: build-kernel build-gcc1
> $(Q)$(call cd_pkg,glibc) && $(RM) -f -r build && $(MKDIR) build
> $(Q)$(call cd_pkg,glibc) && cd build && ../configure \
$(libc_flags) $(libc_kernel_flags) $(libc_target_flags) \
CC=$(prefix)/bin/$(toolchain)-gcc \
CXX=$(prefix)/bin/$(toolchain)-g++ \
GPROF=$(prefix)/bin/$(toolchain)-gprof \
$(slibdir_hack)
> $(Q)$(call cd_pkg,glibc) && cd build && $(make_j)
> $(Q)$(call cd_pkg,glibc) && cd build && $(make_j) install \
DESTDIR=$(sysroot)

@alexrp alexrp added area: build Issues related to the build system. state: deliberation Issues that require design work and/or discussion. type: housekeeping labels Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build Issues related to the build system. state: deliberation Issues that require design work and/or discussion.
Projects
None yet
Development

No branches or pull requests

1 participant