Re: help cross-compiling gcc

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

 



Vincent Fortier via Gcc-help kirjoitti 29.12.2022 klo 23.24:
Hi all,

I've been trying to cross-compile various versions of gcc using the
Synology DSM6 and DSM7 toolchains and kernel for various archs
(armv5-7-8, ppc, i686, x64).

Over the years I've been actively working on the SynoCommunity project
that provides a framework to help integrate free software and generate
linux packages that can be installed on Synology NAS (ref:
https://github.com/SynoCommunity/spksrc)

Pertaining to gcc, my first attempt has been to try to build the same
compiler as the one used on various versions of DSM6 (gcc-4.9) and
DSM7 (gcc-7.5).
OK...
   In order to do so I use the Synology provided
toolchain and prepare the associated kernel with proper platform
configuration in order to provide its headers.
Not understood. Why you think that you must replace the kernel headers coming
with the Synology-made toolchain?
In extra I look
forward into applying crosstool-ng patches.
What you do expect finding in these patches?
As a relatively "simple" example, I've been working on cross-compiling
for a x86_64 host/target using DSM6 with gcc-4.9.4.  So far I was only
able to build the gcc C compiler (beginner's luck?).  Enabling any
other languages fails so has trying newer versions of gcc on that
particular platform.
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++ :

libtool: compile:  /home/src/gcc-8.5.0/build/./gcc/xgcc -shared-libgcc -B/home/src/gcc-8.5.0/build/./gcc -nostdinc++ -L/home/src/gcc-8.5.0/build/i686-syno_r1000-linux-gnu/libstdc++-v3/src -L/home/src/gcc-8.5.0/build/i686-syno_r1000-linux-gnu/libstdc++-v3/src/.libs -L/home/src/gcc-8.5.0/build/i686-syno_r1000-linux-gnu/libstdc++-v3/libsupc++/.libs -B/opt/cross/i686-syno_r1000-linux-gnu/bin/ -B/opt/cross/i686-syno_r1000-linux-gnu/lib/ -isystem /opt/cross/i686-syno_r1000-linux-gnu/include -isystem /opt/cross/i686-syno_r1000-linux-gnu/sys-include -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DHAVE_RPC_XDR_H=1 -DHAVE_TIRPC_RPC_XDR_H=0 -I. -I../../../../libsanitizer/sanitizer_common -I.. -I ../../../../libsanitizer/include -isystem ../../../../libsanitizer/include/system -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -I../../libstdc++-v3/include -I../../libstdc++-v3/include/i686-syno_r1000-linux-gnu -I../../../../libsanitizer/../libstdc++-v3/libsupc++ -std=gnu++11 -DSANITIZER_LIBBACKTRACE -DSANITIZER_CP_DEMANGLE -I ../../../../libsanitizer/../libbacktrace -I ../libbacktrace -I ../../../../libsanitizer/../include -include ../../../../libsanitizer/libbacktrace/backtrace-rename.h -g -O2 -D_GNU_SOURCE -g -Os -MT sanitizer_platform_limits_posix.lo -MD -MP -MF .deps/sanitizer_platform_limits_posix.Tpo -c ../../../../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

Seemingly the 'include/scsi/scsi.h' was changed either in newer glibcs or kernel headers, I don't remember where these SCSI headers belong. The CentOS 5 and 6 '/usr/include' headers still have this :

/*
 * Here are some scsi specific ioctl commands which are sometimes useful.
 */
/* These are a few other constants only used by scsi devices.  */

#define SCSI_IOCTL_GET_IDLUN 0x5382

/* Used to turn on and off tagged queuing for scsi devices.  */

#define SCSI_IOCTL_TAGGED_ENABLE 0x5383
#define SCSI_IOCTL_TAGGED_DISABLE 0x5384

/* Used to obtain the host number of a device.  */
#define SCSI_IOCTL_PROBE_HOST 0x5385

The Synology R1000 headers only mention that these values 0x5383 and 0x5384 "were once defined".

Let's see what one should do with this problem...




[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