Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 513884 - sys-kernel/linux-headers: does not respect BUILD_CC
Summary: sys-kernel/linux-headers: does not respect BUILD_CC
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-19 20:52 UTC by Michał Górny
Modified: 2018-01-30 06:21 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log proving the issue (sys-kernel:linux-headers-3.15:20140619-204836.log,94.47 KB, text/x-log)
2014-06-19 20:52 UTC, Michał Górny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-06-19 20:52:06 UTC
Created attachment 379284 [details]
Build log proving the issue

Just noticed this after it broke my distcc build by mixing 32- and 64-bit 'gcc' (instead of i686-pc-...).

If you do:

  MAKEOPTS='V=1' emerge -1vB linux-headers

you can notice the calls like:

  gcc -Wp,-MD,arch/x86/tools/.relocs_32.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer   -I/tmp/portage/sys-kernel/linux-headers-3.15/work/gentoo-headers-base-3.15/tools/include  -c -o arch/x86/tools/relocs_32.o arch/x86/tools/relocs_32.c

Also, I suggest you enable verbose logs by default. They help a lot.
Comment 1 SpanKY gentoo-dev 2014-06-19 21:49:54 UTC
those are build-time tools, so they should not be using $CC
Comment 2 Kalin KOZHUHAROV 2014-10-22 04:48:41 UTC
Just hit this with linux-headers-3.17 on purely 32bit system...

>>> Install linux-headers-3.17 into /var/tmp/portage/sys-kernel/linux-headers-3.17/image/ category sys-kernel
make -j12 -l2 headers_install INSTALL_HDR_PATH=/var/tmp/portage/sys-kernel/linux-headers-3.17/image///usr/include/.. ARCH=x86 CROSS_COMPILE=i686-pc-linux-gnu-
  CHK     include/generated/uapi/linux/version.h
  UPD     include/generated/uapi/linux/version.h
  WRAP    arch/x86/include/generated/asm/clkdev.h
  WRAP    arch/x86/include/generated/asm/cputime.h
  WRAP    arch/x86/include/generated/asm/scatterlist.h
  WRAP    arch/x86/include/generated/asm/mcs_spinlock.h
  WRAP    arch/x86/include/generated/asm/early_ioremap.h
  SYSTBL  arch/x86/syscalls/../include/generated/asm/syscalls_32.h
  SYSHDR  arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h
  SYSHDR  arch/x86/syscalls/../include/generated/uapi/asm/unistd_64.h
  SYSHDR  arch/x86/syscalls/../include/generated/uapi/asm/unistd_x32.h
  HOSTCC  arch/x86/tools/relocs_32.o
  HOSTCC  arch/x86/tools/relocs_common.o
  HOSTCC  arch/x86/tools/relocs_64.o
arch/x86/tools/relocs_common.c: In function �main�:
arch/x86/tools/relocs_common.c:36:185: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
arch/x86/tools/relocs_common.c:36:221: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
...

linux-headers-3.16 seems to have been emerge fine on 2014-08-13, but fails with the same error now. So I guess an eclass change triggered this?
Comment 3 SpanKY gentoo-dev 2018-01-30 06:21:11 UTC
i fixed this starting in linux-3.18 with the patch:

00_all_0006-x86-do-not-build-relocs-tool-when-installing-headers.patch
From 1fae43bfd87b1a72bbd1060dc6407d601238526e Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Sat, 15 Nov 2014 03:37:38 -0500
Subject: [PATCH] x86: do not build relocs tool when installing headers

This isn't needed to install headers, so don't bother building it.
Otherwise we run into a chicken/egg issue where we need the kernel
headers in order to install the kernel headers.  It's also a waste
of time.