compile source bits, not necessarily the kernel, requires toolchain... which one?[SOLVED]

Post here if you are a new Porteus member and you're looking for some help.
User avatar
omero
White ninja
White ninja
Posts: 22
Joined: 31 Aug 2019, 10:49
Distribution: omerux-4v

compile source bits, not necessarily the kernel, requires toolchain... which one?[SOLVED]

Post#1 by omero » 13 Sep 2019, 02:41

Hello. Long story short: New to porteus, not unfamiliar with building things from source.
Problem> I want to build something from source, but
gcc is missing,
binutils are missing..

tried installing via usm both
gcc
binutuls

still gcc complains even on classic init main()...
seems missing a /usr/lib/gcc/i586-slackware-linux/5.3.0/../../../../i586-slackware-linux/bin/ld: cannot find /usr/lib/libc_nonshared.

Ive been perusing the forums and tried explaining what´s wrong on the minichat...
been suggested to install devel.xzm module, via one of the mirrors>

more digging around the suggested mirrors http://porteus.org/porteus-mirrors.html
turns up some *devel.xzm* modules, not sure what to install though... I assume the most recent based on timestamp and version of porteus...

Been told that *devel.xzm* should provide gcc and all related tools... but... NO.

Thus, in the end... What I need to have proper binutils&(g)cc in order to simply fetch source,
unpack, enter directory (please, don´t say folder) where the source bits were unpacked and... get going into business? All I want is just a working gcc :D

this seems relevant/similar but it is not>
GCC can't compile my .C file


sincerely, omero
Last edited by omero on 13 Sep 2019, 05:43, edited 1 time in total.

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 2252
Joined: 20 Mar 2012, 03:42
Distribution: 5.0rc1-64bit all-DE+more
Location: australia
Contact:

compile source bits, not necessarily the kernel, requires toolchain... which one?

Post#2 by ncmprhnsbl » 13 Sep 2019, 03:56

ok, first up : check what you are using:

Code: Select all

$cat /etc/porteus-version
$ uname -m
if it's porteus 4.0 i586 : http://ftp.nluug.nl/os/Linux/distr/port ... -devel.xzm is what you want.
download it, move it to someplace safe( eg. /mnt/<your install media>/porteus/optional/ ) and activate it (double click in filemanager or rightclick> 'Activate')
or even in a terminal (as root): activate /path/to/devel.xzm .. all necessary build tools and headers should now be available..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
omero
White ninja
White ninja
Posts: 22
Joined: 31 Aug 2019, 10:49
Distribution: omerux-4v

compile source bits, not necessarily the kernel, requires toolchain... which one?

Post#3 by omero » 13 Sep 2019, 04:11

bash-4.4$ uname -a
Linux porteus 4.16.3-porteus #1 SMP PREEMPT Sat Apr 21 18:14:53 Local time zone must be set-- i686 Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz GenuineIntel GNU/Linux

bash-4.4$ cat /etc/porteus-version
Porteus-v4.0

bash-4.4$ ls -al /mnt/sda6/porteus/modules/
total 157320
dr-xr-xr-x 2 root root 4096 Sep 12 03:17 .
dr-xr-xr-x 7 root root 4096 Aug 31 05:13 ..
-rw-r--r-- 1 omero orx 92377088 Sep 12 03:08 05-devel.xzm
-rw-r--r-- 1 root root 60100608 Aug 31 17:38 firefox-68.0.2esr-i686-en-US-1.xzm
-rw-r--r-- 1 root root 8433664 Sep 5 15:08 vim-7.4.1938-i586-1.xzm


did try activate 05-devel.xzm, in order to check that indeed had gcc... alas, fails.

bash-4.4$ gcc
bash: gcc: command not found

root@porteus:/home/omero# ls -al /mnt/sda6/porteus/modules/
total 157320
dr-xr-xr-x 2 root root 4096 Sep 12 03:17 ./
dr-xr-xr-x 7 root root 4096 Aug 31 05:13 ../
-rw-r--r-- 1 omero orx 92377088 Sep 12 03:08 05-devel.xzm
-rw-r--r-- 1 root root 60100608 Aug 31 17:38 firefox-68.0.2esr-i686-en-US-1.xzm
-rw-r--r-- 1 root root 8433664 Sep 5 15:08 vim-7.4.1938-i586-1.xzm
root@porteus:/home/omero# activate /mnt/sda6/porteus/modules/05-devel.xzm
Quiet mode: off
root@porteus:/home/omero# gcc
bash: gcc: command not found
root@porteus:/home/omero# activate /mnt/sda6/porteus/modules/05-devel.xzm
Quiet mode: off
05-devel.xzm: The module can't be removed, because it's busy (used).
Last edited by omero on 13 Sep 2019, 04:25, edited 1 time in total.

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 2252
Joined: 20 Mar 2012, 03:42
Distribution: 5.0rc1-64bit all-DE+more
Location: australia
Contact:

compile source bits, not necessarily the kernel, requires toolchain... which one?

Post#4 by ncmprhnsbl » 13 Sep 2019, 04:24

omero wrote:
13 Sep 2019, 04:11
did try activate 05-devel.xzm, in order to check that indeed had gcc... alas, fails.
fails.. in what way? any message?
what does:

Code: Select all

ls /mnt/live/memory/images/
show?
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
omero
White ninja
White ninja
Posts: 22
Joined: 31 Aug 2019, 10:49
Distribution: omerux-4v

compile source bits, not necessarily the kernel, requires toolchain... which one?

Post#5 by omero » 13 Sep 2019, 04:27

ncmprhnsbl wrote:
13 Sep 2019, 04:24
omero wrote:
13 Sep 2019, 04:11
did try activate 05-devel.xzm, in order to check that indeed had gcc... alas, fails.
fails.. in what way? any message?
what does:

Code: Select all

ls /mnt/live/memory/images/
show?
root@porteus:/home/omero# ls /mnt/live/memory/images
000-kernel.xzm/ 001-core.xzm/ 002-xorg.xzm/ 003-xfce.xzm/ 05-devel.xzm/ firefox-68.0.2esr-i686-en-US-1.xzm/ vim-7.4.1938-i586-1.xzm/

User avatar
omero
White ninja
White ninja
Posts: 22
Joined: 31 Aug 2019, 10:49
Distribution: omerux-4v

compile source bits, not necessarily the kernel, requires toolchain... which one?

Post#6 by omero » 13 Sep 2019, 04:30

root@porteus:/home/omero# mount
tmpfs on /mnt/live type tmpfs (rw,relatime,mode=755)
proc on /mnt/live/proc type proc (rw,relatime)
sysfs on /mnt/live/sys type sysfs (rw,relatime)
none on /mnt/live/dev type devtmpfs (rw,relatime,size=1030408k,nr_inodes=219602,mode=755)
/dev/sda1 on /mnt/sda1 type ext3 (rw,noatime,nodiratime,data=ordered)
/dev/sda5 on /mnt/sda5 type ext3 (rw,noatime,nodiratime,data=ordered)
/dev/sda6 on /mnt/sda6 type ext3 (rw,noatime,nodiratime,data=ordered)
/dev/sda7 on /mnt/sda7 type ext3 (rw,noatime,nodiratime,data=ordered)
/dev/sda6 on /mnt/live/memory/changes type ext3 (rw,noatime,nodiratime,data=ordered)
aufs on / type aufs (rw,relatime,si=ff1c731,nowarn_perm)
/mnt/sda6/porteus/base/000-kernel.xzm on /mnt/live/memory/images/000-kernel.xzm type squashfs (ro,relatime)
/mnt/sda6/porteus/base/001-core.xzm on /mnt/live/memory/images/001-core.xzm type squashfs (ro,relatime)
/mnt/sda6/porteus/base/002-xorg.xzm on /mnt/live/memory/images/002-xorg.xzm type squashfs (ro,relatime)
/mnt/sda6/porteus/base/003-xfce.xzm on /mnt/live/memory/images/003-xfce.xzm type squashfs (ro,relatime)
/mnt/sda6/porteus/modules/05-devel.xzm on /mnt/live/memory/images/05-devel.xzm type squashfs (ro,relatime)
/mnt/sda6/porteus/modules/firefox-68.0.2esr-i686-en-US-1.xzm on /mnt/live/memory/images/firefox-68.0.2esr-i686-en-US-1.xzm type squashfs (ro,relatime)
/mnt/sda6/porteus/modules/vim-7.4.1938-i586-1.xzm on /mnt/live/memory/images/vim-7.4.1938-i586-1.xzm type squashfs (ro,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=1030408k,nr_inodes=219602,mode=755)
tmpfs on /dev/shm type tmpfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,relatime,mode=755)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
gvfsd-fuse on /tmp/xdg-runtime-omero/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=9000,group_id=9000)

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 2252
Joined: 20 Mar 2012, 03:42
Distribution: 5.0rc1-64bit all-DE+more
Location: australia
Contact:

compile source bits, not necessarily the kernel, requires toolchain... which one?

Post#7 by ncmprhnsbl » 13 Sep 2019, 04:38

ok, that shows devel.xzm is activated..

Code: Select all

ls /var/log/packages/gcc*
should confirm gcc package is present.. how are you checking for it's presence?
perhaps something you have done is interferrring.. if so, reboot without the changes cheatcode:
at boot menu: press tab : edit boot line to remove "changes=*" part > enter
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
omero
White ninja
White ninja
Posts: 22
Joined: 31 Aug 2019, 10:49
Distribution: omerux-4v

compile source bits, not necessarily the kernel, requires toolchain... which one?

Post#8 by omero » 13 Sep 2019, 05:28

ncmprhnsbl wrote:
13 Sep 2019, 04:38
ok, that shows devel.xzm is activated..

Code: Select all

ls /var/log/packages/gcc*
should confirm gcc package is present.. how are you checking for it's presence?
perhaps something you have done is interferrring.. if so, reboot without the changes cheatcode:
at boot menu: press tab : edit boot line to remove "changes=*" part > enter



root@porteus:/home/omero# ls -al /var/log/packages/|grep gcc
-rw-r--r-- 1 root root 351 Apr 22 2018 extra-gcc-libs-7.3.0-i586-1jay
-rw-r--r-- 1 root root 43439 Apr 21 2018 gcc-7.3.0-i586-1
-rw-r--r-- 1 root root 42521 Apr 21 2018 gcc-g++-7.3.0-i586-1


gcc should be there... however, how Am I cheching? gcc --version> gcc not found

however...

bash-4.4$ g++ --version
g++ (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

bash-4.4$



root@porteus:/home/omero# ls -al /var/log/packages/gcc*
-rw-r--r-- 1 root root 43439 Apr 21 2018 /var/log/packages/gcc-7.3.0-i586-1
-rw-r--r-- 1 root root 42521 Apr 21 2018 /var/log/packages/gcc-g++-7.3.0-i586-1
r

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 2252
Joined: 20 Mar 2012, 03:42
Distribution: 5.0rc1-64bit all-DE+more
Location: australia
Contact:

compile source bits, not necessarily the kernel, requires toolchain... which one?

Post#9 by ncmprhnsbl » 13 Sep 2019, 06:36

path of least resistance: reboot > choose "Always Fresh" at the boot menu (this will eliminate any possible problems with any changes you have made)
then activate devel.xzm and see how that goes..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
omero
White ninja
White ninja
Posts: 22
Joined: 31 Aug 2019, 10:49
Distribution: omerux-4v

compile source bits, not necessarily the kernel, requires toolchain... which one?

Post#10 by omero » 13 Sep 2019, 21:34

Updated situation:
+ reboot in ¨AlwaysFresh¨
+ in a terminal (as root), activate porteus/modules/05-devel.xzm, got OK confirmation
+ gcc --version shows up with meaningful infos
+ create test.c (classic bare minimum)
+ gcc test.c works and produces a.out

This confirms that modules itself is good... Thus, reboot in ´graphical mode/standard´
+ repeat module activation as above, get OK confirmation... And gcc is nowhere to be found...

At this point I went a bit wild.
+ tried comparing content of /usr/bin (pre-activation, post-activation),
this revealed that something was indeed been added, but lots of things were missing.
I have the logs of (almost) every step of the investigation safely stored away,
but after a couple hours of cursing is several languages, I resorted to a more drastic workaround:
I booted again in ¨AlwaysFresh¨,
moved away the entiere ¨changes¨ directory (in a different empty partition)
rebooted in standard systems and of course all my changes were gone.
Placed the 05-devel.xzm in his proper location again, and activated it.

Success! Now gcc and all ´related´ goodies are there.
And gcc is doing its job.

I´d still would like to know what happened,
my guess would be it was the attempt at installing gcc/binutils via USM earlier.
Just a guess though... At this point I won´t waste more in investigating,
since I´ll have to rework the system configuration from scratch *SIGH*

Thank you for your patience ncmprhnsbl, :)

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 2252
Joined: 20 Mar 2012, 03:42
Distribution: 5.0rc1-64bit all-DE+more
Location: australia
Contact:

compile source bits, not necessarily the kernel, requires toolchain... which one?

Post#11 by ncmprhnsbl » 13 Sep 2019, 21:58

omero wrote:
13 Sep 2019, 21:34
my guess would be it was the attempt at installing gcc/binutils via USM earlier.
that would be my guess too: when things are removed, a "whiteout" file is created, which when the layered filesystem is constucted live, things that wold otherwise be there, aren't.
omero wrote:
13 Sep 2019, 21:34
since I´ll have to rework the system configuration from scratch *SIGH*
not necessarily.. since most settings will be under /home and /etc, you probly just delete all else (maybe keep /var) from your changes dir..
i noticed that you appear to have created you own user account: this may or may not cause problems.. more likely, depending on the DE your using, some porteus custom filemanager features might be missing> look at /home/guest dotfiles for clues..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
omero
White ninja
White ninja
Posts: 22
Joined: 31 Aug 2019, 10:49
Distribution: omerux-4v

compile source bits, not necessarily the kernel, requires toolchain... which one?

Post#12 by omero » 14 Sep 2019, 01:05

ncmprhnsbl, adding my own username instead of using default guest was my 1st priority,
My assumption was that adding my own user wouldn´t interfere with ´Porteus´
and probably I used ´consolidated habit' of doing ´groupadd/useradd´ as ´the old way´...
I understand this might have interfered with ´Porteus´ best practices.

I would still like to understand what went wrong for at least two reasons:
a) avoid doing such ´wrongdoings´ in the future
b) have a fallback ´changes´ where all is known to work

I now have what seems to be a ´sane´ system again,
but I cannot be afraid of doing ´things´ in the middle of testing something...
I might even do things without even realizing its going to ... ahem... royally mess up the next reboot!

Not having thought about the ¨Always Fresh¨ option for investigation,
does indeed qualifies me as the ¨Porteus Rookie of the Week¨ :lol:

Im positive that trying installing binutils/gcc via USM wasn´t the brightest idea... :P
Did read references to 05-devel.xzm only after getting swamped in a mire, and then it was Too Late(Tm). :evil:

BTW, the 05-devel.xzm module should be (seriously) advertised as:
´THE PORTEUS MODULE ONE NEEDS´ when:
a) building custom kernel,
b) building source bits,
c) CAVEAT EMPTOR:
DO NOT install random packages from random repositories
UNLESS You Know EXACTLY What You Are Doing

Cheers,
omero

User avatar
omero
White ninja
White ninja
Posts: 22
Joined: 31 Aug 2019, 10:49
Distribution: omerux-4v

compile source bits, not necessarily the kernel, requires toolchain... which one?

Post#13 by omero » 14 Sep 2019, 01:16

ncmprhnsbl wrote:
13 Sep 2019, 21:58
not necessarily.. since most settings will be under /home and /etc, you probly just delete all else (maybe keep /var) from your changes dir..
i noticed that you appear to have created you own user account: this may or may not cause problems.. more likely, depending on the DE your using, some porteus custom filemanager features might be missing> look at /home/guest dotfiles for clues..
Forum Rules : Forum Rules (read before posting)
Top
I probably want to get more aquainted with the ´Porteus´ general system before scr.. ahem... doing more chages out of simple curiosity now... I did a ´rsync´ of that ´changes´... and will use it to investigate further... right now, back to install irssi from source :D
noticed that irssi is very outdated on every repository... yeah right... I´ll stay away from USM for a while :P

Im wondering if there is some strategy in between -Always Fresh- and -Good Life- (where good life = changes that is known to work)

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 2252
Joined: 20 Mar 2012, 03:42
Distribution: 5.0rc1-64bit all-DE+more
Location: australia
Contact:

compile source bits, not necessarily the kernel, requires toolchain... which one?

Post#14 by ncmprhnsbl » 14 Sep 2019, 03:01

there is an uptodate irssi package in Slackware current that might work: irssi-1.2.2-i586-1.txz
there is a utility txz2xzm that will convert a package to a module
porteus 4.0 was built with slackware current packages at the time(more than a year ago) but since current is a rolling repo, not everything is still compatible..there generally good compatiblity with 14.2, but this tends to mean older packages.. (porteus 5.0 is in the works)
if not, these sources may be useful : https://mirrors.slackware.com/slackware ... e/n/irssi/
just a matter of downloading the contents of that url and executing : # sh irssi.SlackBuild and package will be created(provided build deps are met)

as to strategies for retaining changes, there are few ways to go:
1. standard, your are familiar with.. basicly everything
2. magic folders: menu>system>porteus settings centre>save(icon)>magic folders choose source folder eg /home or /home/omero/.config or ... and a target to save to (can be dir or .dat archive)
3. make a module(s) of your configs: make a fakeroot eg. here's my settings module: (passwords and firewall start)
(the settings centre will offer to make such a module if you're not using 'changes'.)

Code: Select all

/mnt/live/memory/images/psc-settings.xzm
└── etc
    ├── rc.d
    │   └── rc.FireWall
    └── shadow
or my web browser settings:

Code: Select all

/mnt/live/memory/images/brswrset.xzm
└── home
    └── guest
        ├── .moonchild productions
        │   └── pale moon
        │       ├── 711x24qh.default
        │       │   ├── .parentlock
        │       │   ├── cert8.db
        │       │   ├── compatibility.ini
        │       │   ├── content-prefs.sqlite
        │       │   ├── cookies.sqlite
        │       │   ├── cookies.sqlite-shm
        │       │   ├── cookies.sqlite-wal
        │       │   ├── extension-data
        │       │   │   └── ublock0.sqlite
        │       │   ├── extensions
        │       │   │   └── uBlock0@raymondhill.net.xpi
        │       │   ├── extensions.ini
        │       │   ├── extensions.json
        │       │   ├── formhistory.sqlite
        │       │   ├── gmp
        │       │   ├── key3.db
        │       │   ├── lock -> 127.0.0.1:+2097
        │       │   ├── logins.json
        │       │   ├── mimeTypes.rdf
        │       │   ├── permissions.sqlite
        │       │   ├── places.sqlite
        │       │   ├── places.sqlite-shm
        │       │   ├── places.sqlite-wal
        │       │   ├── prefs.js
        │       │   ├── search.json
        │       │   ├── secmod.db
        │       │   ├── sessionCheckpoints.json
        │       │   ├── sessionstore.js
        │       │   ├── webappsstore.sqlite
        │       │   ├── webappsstore.sqlite-shm
        │       │   ├── webappsstore.sqlite-wal
        │       │   └── xulstore.json
        │       └── profiles.ini
        └── .mozilla
            └── firefox
                ├── dxsqumip.default
                │   ├── key3.db
                │   ├── logins.json
                │   ├── places.sqlite
                │   ├── places.sqlite-shm
                │   ├── places.sqlite-wal
                │   ├── prefs.js
                │   └── search.json.mozlz4
                └── profiles.ini

11 directories, 38 files
this method requires manual updating if desired..

a usefull tool to find what files are changed when doing stuff is: # changes-time which will dump a fakeroot of changes in /root
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
omero
White ninja
White ninja
Posts: 22
Joined: 31 Aug 2019, 10:49
Distribution: omerux-4v

compile source bits, not necessarily the kernel, requires toolchain... which one?

Post#15 by omero » 14 Sep 2019, 05:20

Ok. Will investigate what that means, ncmprhnsbl, .
I will say this against my own interest to discuss further, since this was something of a ´new to porteus´ issue.
For every question, expect an answer that will spawn a new question

This can be considered as ´closed/solved' from a strict ´topic´ point of view (unsure, Im not very Forum-oriented).
Installing irssi from source will be a new topic, :P double :P

Post Reply