Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 710678 - sys-kernel/mips-sources - several kernel build errors - ip28 (PATCH)
Summary: sys-kernel/mips-sources - several kernel build errors - ip28 (PATCH)
Status: IN_PROGRESS
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: MIPS Linux
: Normal normal (vote)
Assignee: Joshua Kinard
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: 711900
  Show dependency tree
 
Reported: 2020-02-24 17:10 UTC by Barnabás Virágh
Modified: 2022-10-07 17:45 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to build fix (mips_fix_ip28.patch,977 bytes, text/plain)
2020-02-24 17:10 UTC, Barnabás Virágh
Details
My kernel config used to build (.config,46.49 KB, application/xml)
2020-02-24 17:11 UTC, Barnabás Virágh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Barnabás Virágh 2020-02-24 17:10:23 UTC
Created attachment 615464 [details]
patch to build fix

Native compiling the just emerged sys-kernel/mips-sources in user mode qemu (qemu-mips64) yields several errors:
1.)
# make ip28_defconfig
Makefile:527: arch/mips64/Makefile: No such file or directory
make: *** No rule to make target 'arch/mips64/Makefile'.  Stop.

For a workaround, I made a symlink in arch/mips64
# cd /usr/src/linux/arch
# ln -s mips mips64

Later, during compile I saw some references through that mips64 symlink to include, etc... would be worth cleaning up?

Than there was an undefined method call in drivers/video/fbdev/impact.c to dma_[alloc|free]_noncoherent, which was removed by this patch 3 years earlier:
https://lore.kernel.org/patchwork/patch/825437/

Corrected in the patch I attached.

Also, the arch/mips/vdso/vdso.lds.S had an undefined or wrongly defined "mips" define, which produced wrong arch/mips/vdso/vdso.lds, which later thus had syntax error in there. Also corrected in the attached patch.

So far it builds at least, not tested in runtime yet.

(Note the "-mr10k-cache-barrier=none" in my make.conf is only required to make gcc produce code, that qemu-mips64 can also run, since it doesn't implement cache related instructions).

# emerge --info sys-kernel/mips-sources:
Portage 2.3.84 (python 2.7.17-final-0, default/linux/mips/17.0/n64, gcc-9.2.0, glibc-2.29-r7, 4.19.97-gentoo-x86_64 mips64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.19.97-gentoo-x86_64-mips64-with-gentoo-2.6
KiB Mem:    32864032 total,  30432604 free
KiB Swap:   33554424 total,  33554424 free
Timestamp of repository gentoo: Wed, 19 Feb 2020 02:45:01 +0000
Head commit of repository gentoo: cec727ad614986ca1e6b9468eea7f1a5a9183382
sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.32 p3) 2.32.0
app-shells/bash:          4.4_p23-r1::gentoo
dev-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.17::gentoo, 3.6.9::gentoo, 3.7.5-r1::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.32-r2::gentoo
sys-devel/gcc:            9.2.0-r2::gentoo
sys-devel/gcc-config:     2.2::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo                                                                                                                                                                                                               sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: -L
    sync-rsync-verify-max-age: 24

Installed sets: @favorites
ACCEPT_KEYWORDS="* mips"                                                                                                                                                                                                                     ACCEPT_LICENSE="@FREE"
CBUILD="mips64-unknown-linux-gnu"
CFLAGS="-O2 -pipe -mabi=64 -mplt -march=mips4 -mtune=r10k -mfix-r10000 -mr10k-cache-barrier=none"                                                                                                                                            CHOST="mips64-unknown-linux-gnu"                                                                                                                                                                                                             CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"                                                                                                                                                                                         CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"                                                                                                   CXXFLAGS="-O2 -pipe -mabi=64 -mplt -march=mips4 -mtune=r10k -mfix-r10000 -mr10k-cache-barrier=none"                                                                                                                                          DISTDIR="/var/cache/distfiles"                                                                                                                                                                                                               EMERGE_DEFAULT_OPTS="--quiet-build=y --keep-going=y --buildpkg --usepkg --binpkg-respect-use=y --buildpkg-exclude 'virtual/*' --jobs=6 --load-average 10"                                                                                    ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe -mabi=64 -mplt -march=mips4 -mtune=r10k -mfix-r10000 -mr10k-cache-barrier=none"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles merge-sync multilib-strict news parallel-fetch parallel-install preserve-libs protect-
owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersync xattr"
FFLAGS="-O2 -pipe -mabi=64 -mplt -march=mips4 -mtune=r10k -mfix-r10000 -mr10k-cache-barrier=none"
GENTOO_MIRRORS="rsync://bastille.home.hive/distfiles"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j12"
PKGDIR="/var/cache/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="-L"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl alsa berkdb big-endian bzip2 cli crypt cryptsetup cups curl cxx gdbm gpg iconv icu kerberos libinput ljr mips ncurses nfs nls nptl openssl pam pcre radius readline seccomp snmp split-usr ssl syslog tcpd threads tls udev unicode usb xattr zlib" ABI_MIPS="n64" ADA_TARGET="gnat_2018" ALSA_CARDS="au1x00" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CURL_SSL="openssl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" L10N="hu en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby25" USERLAND="GNU" VIDEO_CARDS="fbdev impact dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

=================================================================
                        Package Settings
=================================================================

sys-kernel/mips-sources-4.19.79::gentoo was built with the following:
USE="ip28 -build -experimental -ip27 -ip30 -symlink"
Comment 1 Barnabás Virágh 2020-02-24 17:11:19 UTC
Created attachment 615466 [details]
My kernel config used to build
Comment 2 Barnabás Virágh 2020-02-25 08:16:10 UTC
In the meantime, I managed to netboot the kernel with attached patch (also enabled the fbconsole in it first), and now I have console output during boot, so it seems to be working. Though, the kernel goes panic, since it can't initialize SCSI and ethernet driver, thus cannot mount root. But this will be a new bug, I guess.
Comment 3 Joshua Kinard gentoo-dev 2020-02-26 04:58:06 UTC
I last tested IP28 (real hardware) out about a year ago with a preliminary netboot image I built.  Booted to the netboot userland, and got networking to play a little nice, but touching SCSI virtually killed the machine immediately.  This is a known problem of the non-coherent nature of IP28 systems on an R10000 processor.    I've never used qemu to emulate that machine target, so I can't speak for any issues there, nor really support any.  Real hardware only.

Which version of mips-sources did you try?  I know I dealt with the renaming of the dma_* functions awhile back, but can't remember if I rolled them into a patch or not.

arch/mips64 hasn't existed in ages.  It's all merged into arch/mips now.  I assume ip28_defconfig has a reference to arch/mips64 in it that needs to be removed or changed.  That would need to go upstream via the linux-mips mailing list instead of into mips-sources (though I can look at adding it later after 5.6 is released if I can get Octane running again under 5.6).  I'll wager your issue with VDSO might stem from attempting to symlink arch/mips to mips64.  If not, then that fix would also need to go upstream instead.
Comment 4 Barnabás Virágh 2020-02-26 09:13:36 UTC
(In reply to Joshua Kinard from comment #3)
> I last tested IP28 (real hardware) out about a year ago with a preliminary
> netboot image I built.  Booted to the netboot userland, and got networking
> to play a little nice, but touching SCSI virtually killed the machine
> immediately.  This is a known problem of the non-coherent nature of IP28
> systems on an R10000 processor.    I've never used qemu to emulate that
> machine target, so I can't speak for any issues there, nor really support
> any.  Real hardware only.
No need to, I don't use qemu-system, just the user land chroot, and only for build. I intend to test on real HW, already netbooted it.


> Which version of mips-sources did you try?  I know I dealt with the renaming
> of the dma_* functions awhile back, but can't remember if I rolled them into
> a patch or not.
sys-kernel/mips-sources-4.19.79::gentoo
(I use on all of my machines 4.19.*, since it is the facto stable on all other archs) Though, I can try out 5.* as well, if needed to.

> arch/mips64 hasn't existed in ages.  It's all merged into arch/mips now.  I
> assume ip28_defconfig has a reference to arch/mips64 in it that needs to be
> removed or changed.  That would need to go upstream via the linux-mips
> mailing list instead of into mips-sources (though I can look at adding it
> later after 5.6 is released if I can get Octane running again under 5.6). 
> I'll wager your issue with VDSO might stem from attempting to symlink
> arch/mips to mips64.  If not, then that fix would also need to go upstream
> instead.
Most probably you are right. My patch is far from professional or any conformance, I can feel that, since I have no knowledge on linux kernel development in general. I just made it as a quick hack, to be able to compile the kernel at least, and to be an exact reference on where I did find problems, and for myself to be able to step closer to a working Indigo2 Impact 10000 linux machine.

Though a more professional/thorough fix would be appreciated. I can help testing it, on real hardware.