public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kai Ruottu <kai.ruottu@wippies.com>
To: gcc-help@gcc.gnu.org
Subject: Re: help cross-compiling gcc
Date: Sat, 31 Dec 2022 14:04:02 +0200	[thread overview]
Message-ID: <eb1f2272-c670-eb6a-5fe1-692dd4667a71@wippies.com> (raw)
In-Reply-To: <CALAySu+Uc9VoW61YMzisvh6GG+TL=At0D+Za84XxB4gD=-efmw@mail.gmail.com>

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...


  reply	other threads:[~2022-12-31 12:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-29 21:24 Vincent Fortier
2022-12-31 12:04 ` Kai Ruottu [this message]
2022-12-31 20:30   ` Vincent Fortier
2022-12-31 20:47     ` Tom Kacvinsky
2022-12-31 21:59     ` Kai Ruottu
2023-04-04  1:23       ` Vincent Fortier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eb1f2272-c670-eb6a-5fe1-692dd4667a71@wippies.com \
    --to=kai.ruottu@wippies.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).