From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61652 invoked by alias); 20 Dec 2019 15:09:43 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Received: (qmail 61644 invoked by uid 89); 20 Dec 2019 15:09:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.6 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=HTo:U*crossgcc, H*c:alternative, H*c:HHHH, HX-Spam-Relays-External:ESMTPA X-HELO: relay6-d.mail.gandi.net Received: from relay6-d.mail.gandi.net (HELO relay6-d.mail.gandi.net) (217.70.183.198) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Dec 2019 15:09:41 +0000 Received: from sogo11.sd4.0x35.net (sogo11.sd4.0x35.net [10.200.201.61]) (Authenticated sender: pmatos@linki.tools) by relay6-d.mail.gandi.net (Postfix) with ESMTPA id 679BAC0002 for ; Fri, 20 Dec 2019 15:09:38 +0000 (UTC) To: crossgcc@sourceware.org User-Agent: SOGoMail 4.0.8 MIME-Version: 1.0 Date: Fri, 20 Dec 2019 15:09:00 -0000 Subject: Specifying Custom Kernel headers Message-ID: <15d6-5dfce400-3-23e84100@72070313> X-Forward: 127.0.0.1 From: =?utf-8?q?pmatos=40linki=2Etools?= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-12/txt/msg00003.txt.bz2 Hello, I am running into trouble building a cross-compiler from a sample for rpi3 = using armv7l (arm32) with crosstool-ng 1.24.0 It looks straightforward, however doing: $ ct-ng armv7-rpi2-linux-gnueabihf $ ct-ng build generates a toolchain that compiles just fine but then using qemu-arm-stati= c to emulate it causes a 'kernel too old' message. So, I noticed that my kernel is 4.15.0-66-generic (ubuntu 18.04) and ct-ng = uses by default kernel headers from 4.20.=C2=A0 I changes the config to ena= ble backwards compatibility to 4.15.0. CT_LINUX_V_4_20=3Dy ... CT_GLIBC_KERNEL_VERSION_CHOSEN=3Dy CT_GLIBC_MIN_KERNEL_VERSION=3D"4.15.0" CT_GLIBC_MIN_KERNEL=3D"4.15.0" Then I rebuild and qemu works but the result is strange. =C2=A0cat listdir.c #include #include #include #include int main(void) { =C2=A0=C2=A0=C2=A0 struct dirent *de; =C2=A0=C2=A0=C2=A0 DIR *dr =3D opendir("/"); =C2=A0=C2=A0=C2=A0 errno =3D 0; =C2=A0=C2=A0=C2=A0 while ((de =3D readdir(dr)) !=3D NULL) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printf("= %s\n", de->d_name); =C2=A0=C2=A0=C2=A0 if (errno =3D=3D EOVERFLOW) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 perror(""); =C2=A0=C2=A0=C2=A0 closedir(dr); =C2=A0=C2=A0=C2=A0 return 0; } When compiled: $ armv7-rpi2-linux-gnueabihf-gcc -static -o listdir listdir.c $ qemu-arm-static -L /home/pmatos/x-tools/armv7-rpi2-linux-gnueabihf/armv7-= rpi2-linux-gnueabihf/sysroot/ ./listdir=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0 Value too large for defined data type I assume this is still related to kernel headers. Possibly I need to use th= e kernel headers for my exact kernel version. Is there a way to do this? If I do: $ ct-ng armv7-rpi2-linux-gnueabihf $ ct-ng menuconfig In Operating System -> Source of linux the only available option is Release= d tarball. Am I correct in saying this is due to the kernel headers version difference= ? Any hints on how to solve this? Kind regards, Paulo Matos =C2=A0