Re: help cross-compiling gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le sam. 31 déc. 2022, à 16 h 59, Kai Ruottu <kai.ruottu@xxxxxxxxxxx> a écrit :
>
> Vincent Fortier kirjoitti 31.12.2022 klo 22.30:
> > Le sam. 31 déc. 2022, à 07 h 05, Kai Ruottu <kai.ruottu@xxxxxxxxxxx> a écrit :
> > 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 CentOS
> >> 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_posix.cc
> >> -fPIC -DPIC -o .libs/sanitizer_platform_limits_posix.o
> >> ../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:902:46:
> >> virhe: ”SCSI_IOCTL_TAGGED_DISABLE” on esittelemättä tällä näkyvyysalueella
> >>      unsigned IOCTL_SCSI_IOCTL_TAGGED_DISABLE = SCSI_IOCTL_TAGGED_DISABLE;
> >> ^~~~~~~~~~~~~~~~~~~~~~~~~
> >> ../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:902:46:
> >> huom: suggested alternative: ”IOCTL_SCSI_IOCTL_TAGGED_DISABLE”
> >>      unsigned IOCTL_SCSI_IOCTL_TAGGED_DISABLE = SCSI_IOCTL_TAGGED_DISABLE;
> >> ^~~~~~~~~~~~~~~~~~~~~~~~~
> >> IOCTL_SCSI_IOCTL_TAGGED_DISABLE
> >> ../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:903:45:
> >> virhe: ”SCSI_IOCTL_TAGGED_ENABLE” on esittelemättä tällä näkyvyysalueella
> >>      unsigned IOCTL_SCSI_IOCTL_TAGGED_ENABLE = SCSI_IOCTL_TAGGED_ENABLE;
> >> ^~~~~~~~~~~~~~~~~~~~~~~~
> >> ../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:903:45:
> >> huom: suggested alternative: ”IOCTL_SCSI_IOCTL_TAGGED_ENABLE”
> >>      unsigned IOCTL_SCSI_IOCTL_TAGGED_ENABLE = SCSI_IOCTL_TAGGED_ENABLE;
> >> ^~~~~~~~~~~~~~~~~~~~~~~~
> >> 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=i686-syno_r1000-linux-gnu-gcc-8.5
> COLLECT_LTO_WRAPPER=/media/2c439158-ef3e-4dcf-a63b-03191c302829/opt/cross/bin/../lib/gcc/i686-syno_r1000-linux-gnu/8.5.0/lto-wrapper
> Kohde: i686-syno_r1000-linux-gnu
> Configured with: ../configure --build=i686-linux-gnu
> --host=i686-linux-gnu --target=i686-syno_r1000-linux-gnu
> --prefix=/opt/cross --libdir=/opt/cross/lib --libexecdir=/opt/cross/lib
> --with-sysroot=/opt/host-i686-syno_r1000-linux-gnu
> --enable-languages=c,c++ --with-arch=i686 --disable-tm-clone-registry
> --disable-multilib --enable-long-long --enable-default-pie
> --enable-__cxa_atexit --enable-cxx-flags=-D_FILE_OFFSET_BITS=64
> --enable-libmudflap --enable-libgomp --enable-libssp
> --enable-libquadmath --enable-libquadmath-support --enable-libsanitizer
> --enable-libmpx --enable-lto --with-host-libstdcxx='-static-libgcc
> -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --enable-threads=posix
> --enable-target-optspace --disable-plugin --enable-gold
> --enable-version-specific-runtime-libs
> --with-gxx-include-dir=/opt/cross/include/c++/8.5.0
> --program-prefix=i686-syno_r1000-linux-gnu- --program-suffix=-8.5
> Säiemalli: 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/39bff938665601f96e060b229c28e88e6aedcd44

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-<ARCH>-<DSM-VERSION>) 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




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux