From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x931.google.com (mail-ua1-x931.google.com [IPv6:2607:f8b0:4864:20::931]) by sourceware.org (Postfix) with ESMTPS id DBD1F3858D1E for ; Tue, 4 Apr 2023 01:23:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DBD1F3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ua1-x931.google.com with SMTP id ay14so22195057uab.13 for ; Mon, 03 Apr 2023 18:23:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680571393; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rOtuiGTh/VHoOk6wFh8/7717NzyMlGX29vRDQX76DBE=; b=PfU87fZ9l7YHEOVQ199xrvxsQm03tAKpIZ/Oq6eNAgRSjaAORKtq3iJYjQf0e+flma r5JM+VNp1WGXje7Fh3dfofigg+vRLKKQoZ0zRUbueYqr32jabcGAbi/4s+Bgam7wi531 /BOCScHfq2NOMJuUJfj5rI9MHQ7E99CWHo6yF7vYX5Mxdcfe3MQdGBeF46I0gRRJTo10 QCKlE2JYnaqRUDRUkyGfhGsgltiqUKjAeqesCKf5FeGUDwQvAvkZ8t00KtZYHHpQmr7I sPGnMudymIvm2Y240RSRr01zRaKj4t8iKCNJMI4TDqzI1Q57Luk9rwSXkZaq7VlbmF8S uz9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680571393; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rOtuiGTh/VHoOk6wFh8/7717NzyMlGX29vRDQX76DBE=; b=B5XYbecTIBdJIWlNzTj0AO/epoERZTFXnqpv874F3WLzeyxvjnLpMl69/p4UdQK4df 2tgArhtxf6IBdMSg4RMImOrAbZg762CZHPe+BdnB4UvkLAjJ9TNJSqhCb2QK7RudF4jJ Drhg2JJnP90oVo9MW8YUdt67wXzxezfaBSm0+NedtZi8QpZA6dZkiXucxVsNDP+cFWul bCNbfwL5vHIn9aUwYQTxN6/hIM3TUx5uP8xIa38A1C2EtXjP2sptRPO14cS+j/zP2IQ3 aua0j00OVOE6P+2lJqeK0K6x7oz9+TiFDuGH1N5Gp9RAkbB9a/uvnB2Ih0ZgCniFIo1Y ZkKQ== X-Gm-Message-State: AAQBX9eEu9pZ9Ijl6/gvj7EgizMNWMrePBvkX6XDb5OP4QI4zbpJ9cZF EKiucsE96ubQvZD7IY4yYemTJchqoGXrHqk7VKljUcFfl2yXLQ== X-Google-Smtp-Source: AKy350b8QrMLGnzLMGszhJ1u4ZqoaxIEI1MO16bkh27yQ/TMo3TDmPdE8WYba+J2yq4a3411iIdWMIqVulQRycIuN78= X-Received: by 2002:ab0:5505:0:b0:764:793a:6618 with SMTP id t5-20020ab05505000000b00764793a6618mr350233uaa.1.1680571393083; Mon, 03 Apr 2023 18:23:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Vincent Fortier Date: Mon, 3 Apr 2023 21:23:02 -0400 Message-ID: Subject: Re: help cross-compiling gcc To: Kai Ruottu Cc: gcc-help@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Le sam. 31 d=C3=A9c. 2022, =C3=A0 16 h 59, Kai Ruottu a =C3=A9crit : > > Vincent Fortier kirjoitti 31.12.2022 klo 22.30: > > Le sam. 31 d=C3=A9c. 2022, =C3=A0 07 h 05, Kai Ruottu a =C3=A9crit : > > As such I expected that the toolchain header files weren't > > sufficient... But I just retested this and it actually did built > > without it, thus meaning it isn't needed. > Quickly checked the 'include' and 'lib' stuff looked quite standard in > the R1000 i686 case. > > For pure curiosity I tried to reproduce the GCC in the > >> 'r1000-gcc850_glibc226_i686-GPL.txz' > >> package. But with the "as it is now" stuff in this Synology toolchain = - > >> with the glibc and kernel > >> headers being provided. And on my old CentOS 6 / i686 host with a Cent= OS > >> 5 / i686 targeted > >> cross gcc-8.5.0. Everything went ok until hitting in this error when > >> compiling libstdc++ : > >> > >> ../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_po= six.cc > >> -fPIC -DPIC -o .libs/sanitizer_platform_limits_posix.o > >> ../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_po= six.cc:902:46: > >> virhe: =E2=80=9DSCSI_IOCTL_TAGGED_DISABLE=E2=80=9D on esittelem=C3=A4t= t=C3=A4 t=C3=A4ll=C3=A4 n=C3=A4kyvyysalueella > >> unsigned IOCTL_SCSI_IOCTL_TAGGED_DISABLE =3D SCSI_IOCTL_TAGGED_DI= SABLE; > >> ^~~~~~~~~~~~~~~~~~~~~~~~~ > >> ../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_po= six.cc:902:46: > >> huom: suggested alternative: =E2=80=9DIOCTL_SCSI_IOCTL_TAGGED_DISABLE= =E2=80=9D > >> unsigned IOCTL_SCSI_IOCTL_TAGGED_DISABLE =3D SCSI_IOCTL_TAGGED_DI= SABLE; > >> ^~~~~~~~~~~~~~~~~~~~~~~~~ > >> IOCTL_SCSI_IOCTL_TAGGED_DISABLE > >> ../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_po= six.cc:903:45: > >> virhe: =E2=80=9DSCSI_IOCTL_TAGGED_ENABLE=E2=80=9D on esittelem=C3=A4tt= =C3=A4 t=C3=A4ll=C3=A4 n=C3=A4kyvyysalueella > >> unsigned IOCTL_SCSI_IOCTL_TAGGED_ENABLE =3D SCSI_IOCTL_TAGGED_ENA= BLE; > >> ^~~~~~~~~~~~~~~~~~~~~~~~ > >> ../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_po= six.cc:903:45: > >> huom: suggested alternative: =E2=80=9DIOCTL_SCSI_IOCTL_TAGGED_ENABLE= =E2=80=9D > >> unsigned IOCTL_SCSI_IOCTL_TAGGED_ENABLE =3D SCSI_IOCTL_TAGGED_ENA= BLE; > >> ^~~~~~~~~~~~~~~~~~~~~~~~ > >> IOCTL_SCSI_IOCTL_TAGGED_ENABLE > >> make[4]: *** [sanitizer_platform_limits_posix.lo] Virhe 1 > >> make[4]: Poistutaan hakemistosta > >> "/media/2c439158-ef3e-4dcf-a63b-03191c302829/home/src/gcc-8.5.0/build/= i686-syno_r1000-linux-gnu/libsanitizer/sanitizer_common" > >> make[3]: *** [all-recursive] Virhe 1 > >> > >> > >> I'm now tempted to patch GCC to remove the definitions from: > >> $ grep -Rl SCSI_IOCTL * > >> libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h > >> libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc > >> libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc > >> > >> Any ideas and/or help much appreciated :) > I didn't invent any solution yet for this SCSI_IOCTL_TAGGED_* problem so I was able to patch scsi.h to get rid of the SCSI_IOCTL_TAGGED_* error. This actually allowed me to get LLVM to build properly. My PR checks here shows error but that is only due to caching github-action current caching. Otherwise works as expected to build out a development package https://github.com/SynoCommunity/spksrc/pull/5225 So far I got all I need with the exception of gcc ... > I simply edited the by-configure-produced Makefile via removing all the > requisites to build libsanitizer. Then everything continued as expected. I really wonder what you did in here to get this going in order to prevent it to build as it is referred everywhere in there? I could script this if you can provide me a few additional pointers. In the meantime I tried variations on the --enable-libsanitizer or --disable-libsanitizer or --disable-libiberty all together... all failing one way or another. > Probably I will rebuild the toolchain from sources again, removing the > '--enable-libsanitizer' in the configure command. And the support for > 'local language'(finnish, seen in the log) via adding the '--disable-nls' > there. The used configure command will be seen here : > > # i686-syno_r1000-linux-gnu-gcc-8.5 -v > Using built-in specs. > COLLECT_GCC=3Di686-syno_r1000-linux-gnu-gcc-8.5 > COLLECT_LTO_WRAPPER=3D/media/2c439158-ef3e-4dcf-a63b-03191c302829/opt/cro= ss/bin/../lib/gcc/i686-syno_r1000-linux-gnu/8.5.0/lto-wrapper > Kohde: i686-syno_r1000-linux-gnu > Configured with: ../configure --build=3Di686-linux-gnu > --host=3Di686-linux-gnu --target=3Di686-syno_r1000-linux-gnu > --prefix=3D/opt/cross --libdir=3D/opt/cross/lib --libexecdir=3D/opt/cross= /lib > --with-sysroot=3D/opt/host-i686-syno_r1000-linux-gnu > --enable-languages=3Dc,c++ --with-arch=3Di686 --disable-tm-clone-registry > --disable-multilib --enable-long-long --enable-default-pie > --enable-__cxa_atexit --enable-cxx-flags=3D-D_FILE_OFFSET_BITS=3D64 > --enable-libmudflap --enable-libgomp --enable-libssp > --enable-libquadmath --enable-libquadmath-support --enable-libsanitizer > --enable-libmpx --enable-lto --with-host-libstdcxx=3D'-static-libgcc > -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --enable-threads=3Dposix > --enable-target-optspace --disable-plugin --enable-gold > --enable-version-specific-runtime-libs > --with-gxx-include-dir=3D/opt/cross/include/c++/8.5.0 > --program-prefix=3Di686-syno_r1000-linux-gnu- --program-suffix=3D-8.5 > S=C3=A4iemalli: posix > gcc-versio 8.5.0 (GCC) Ultimately it's the latest toolchain compatible version I'd like to make available (e.g. 12.x probably feasible for DSM7 using gcc-8.5 cross-compiler). Similar to what I did for LLVM where v9 builds ok from toolchain provided gcc-4.9 for Synology DSM 6.x and LLVM latest (v16) builds fine using toolchain provided gcc-8.5 for Synology DSM 7.x. > The options were copied "selectively" from the original gcc-8.5.0 in the > Synology toolchain > (for a x86_64 host). The '$prefix' was my own standard '/opt/cross' and > the '$sys-root' the > '/opt/host-$target' I tried finding a configuration within various arches toolchains. I couldn't find anything. Where did you find this? Also wondered, if by any chance you have spare cycles to try out building from our spksrc framework that would be really really nice of you. I've committed my current testing & mostly failures with gcc here https://github.com/SynoCommunity/spksrc/pull/5225/commits/39bff9386656= 01f96e060b229c28e88e6aedcd44 The howto use is relatively straight-forward and documented https://github.com/SynoCommunity/spksrc using docker or lxc/lxd. Then its a matter of doing a make setup from the framework root directory and cd cross/gcc then make arch-x64-7.1 (e.g. make arch--) or simply make all-supported (currently no archs are defined as unsupported for gcc as none is working anyway). Additional help or guidance would be much appreciated, thnx! Thnx in advance :) - vin 1,1 Top