Skip to content

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

@alexrp

Description

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)

Activity

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

Metadata

Assignees

No one assigned

    Labels

    area: buildIssues related to the build system.state: deliberationIssues that require design work and/or discussion.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions