LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-08-2018, 07:33 AM   #211
ZhaoLin1457
Senior Member
 
Registered: Jan 2018
Posts: 1,042

Rep: Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250

Quote:
Originally Posted by stoffepojken View Post
You constantly repeat what ever Darth Vader says.
That's it? This is your argument?

Feel free to test yourself. I guess installing 3 packages and editing a LILO entry is trivial for a Linux Guru like you.
 
2 members found this post helpful.
Old 07-08-2018, 08:13 AM   #212
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 917

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
Originally Posted by stoffepojken View Post
Romanians are nazis. What they do to the gipsys are apartheid.
Looking back at your posts here, you've contributed nothing to the topic being discussed. Please consider going away.

chris
 
3 members found this post helpful.
Old 07-08-2018, 08:13 AM   #213
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Sheesh this thread has gotten ugly so please understand that I've not read all the posts in the thread ...

But let me fan the flames a 'bit'

Q: How does one compile and link a 32-bit C-Program on a PURE Slackware64 System ( i.e. a System without 32-bit Header Files and Libraries ) ?

A: One cannot do that as far as I know ...

Here I am working on my PURE Slackware64 14.2+current box ( no Multilib and very few optional packages from SBo or Alien Bob or ... )

Example. This is a small C-Program that executes `uname -a` via the stdlib system() call. I saved the file as /tmp/test-arch.c ( please excuse my old-and-set-in-my-ways formatting )
Code:
#include <stdio.h>
#include <stdlib.h>

int main( int argc, char ** argv )
{
   system(( const char * ) "uname -a" ) ;

   return( 0 ) ;
}
Then on your pure 64-bit system ...
Code:
# compile a native 64-bit version of the example test-arch.c program

$ cd /tmp
$ gcc -o test-arch-64 -m64 test-arch.c
<<no output>>

# list the results

$ ls -la test-arch-64
  -rwxr-xr-x 1 kjh users 14624 Jul  8 07:17 test-arch-64

# what kind of file is test-arch-64 ?

$ file test-arch-64
  test-arch-64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, with debug_info, not stripped

# run the program 

$ ./test-arch-64
  Linux samsung.kjh.home 4.14.53 #2 SMP Tue Jul 3 15:30:34 CDT 2018 x86_64 Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz GenuineIntel GNU/Linux

# what libraries are linked ?

$ ldd test-arch-64

        linux-vdso.so.1 (0x00007ffe489c3000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f4e8e897000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f4e8ec81000)
Note that on my PURE Slackware64 14.2+current system that the linked libraries are all in /lib64/ for this simple program.

Now try to build a 32-bit version of the program:
Code:
$ gcc -o test-arch-32 -m32 test-arch.c

In file included from /usr/include/features.h:452,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from test-arch.c:1:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
           ^~~~~~~~~~~~~~~~
compilation terminated.
It will not compile because there are no 32-bit include files on my PURE Slackware64 System.

And even if it did compile, it would not link because there are no 32-bit libraries on a pure Slackware64 box without Alien Bob's Multilib System.

On the other hand ... on my Slackware64 14.2 + Multilib System:
Code:
$ cd /tmp/

$ gcc -o test-arch-32 -m32 test-arch.c
<<no output>>
$ gcc -o test-arch-64 -m64 test-arch.c
<<no output>>

$ ls -la test-arch-*
  -rwxrwxr-x 1 konrad users 10536 Jul  8 07:24 test-arch-32
  -rwxrwxr-x 1 konrad users 10824 Jul  8 07:23 test-arch-64

$ file test-arch-*
  test-arch-32: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, not stripped
  test-arch-64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, not stripped

$ ldd test-arch-*
test-arch-32:
        linux-gate.so.1 (0xf77d1000)
        libc.so.6 => /lib/libc.so.6 (0xf75c7000)
        /lib/ld-linux.so.2 (0xf77d2000)
test-arch-64:
        linux-vdso.so.1 (0x00007ffd055f7000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fe501481000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fe50184a000)

 ./test-arch-32 
Linux kjhlt6 4.4.139.kjh #1 SMP Thu Jul 5 07:24:46 CDT 2018 x86_64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz GenuineIntel GNU/Linux

$ ./test-arch-64
Linux kjhlt6 4.4.139.kjh #1 SMP Thu Jul 5 07:24:46 CDT 2018 x86_64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz GenuineIntel GNU/Linux
Also for the record, I don't play any games but I have been installing Alien Bob's Multilib on my own systems since he made it available.

This is because I need to compile 32-bit programs for our Customers at work ( Intel 32-bit is the Lowest Common Denominator among all our Customer Systems ).

And I don't have to wait for Alien Bob to update the compat-32 packages ... he kindly provided convertpkg-compat32 and massconvert32.sh so one can convert all the packages you need with each Slackware Update one at a time or all at once as you need.

Finally, I don't have an opinion about including 32-bit include files and libraries on future Slackware64 Systems ... at most I would say make it 'extra' ...

HTH.

-- kjh
 
1 members found this post helpful.
Old 07-08-2018, 08:52 AM   #214
ZhaoLin1457
Senior Member
 
Registered: Jan 2018
Posts: 1,042

Rep: Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250
Quote:
Originally Posted by kjhambrick View Post
Q: How does one compile and link a 32-bit C-Program on a PURE Slackware64 System ( i.e. a System without 32-bit Header Files and Libraries ) ?
If you ask me, I will respond this way:

using a cross-compilation toolchain, just like myself I used uncounted times to build CyanogenMod for the ARM architecture of my smartphone. https://en.wikipedia.org/wiki/CyanogenMod

Last edited by ZhaoLin1457; 07-08-2018 at 09:08 AM.
 
Old 07-08-2018, 09:29 AM   #215
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Quote:
Originally Posted by ZhaoLin1457 View Post
If you ask me, I will respond this way:

using a cross-compilation toolchain, just like myself I used uncounted times to build CyanogenMod for the ARM architecture of my smartphone. https://en.wikipedia.org/wiki/CyanogenMod
Hmmm ... yes, I understand cross-compilation ... But ... I thought this was about the Intel 32-bit Architecture ...

1. A Slackware64 System with a cross-compilation toochain doesn't sound like a pure Slackware64 System ... ( ? maybe just semantics at work here ? )

2. the only cross-compiler that I know of for compiling, linking and running 32-bit programs on a pure Slackware64 System is Alien Bob's Multilib system ... ( I am sure there are other ways to do it but Multilib is certainly the most convenient way to do it )

HTH.

-- kjh
 
Old 07-08-2018, 09:35 AM   #216
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
I fail to understand WHY someone will insists to build 32bit programs on a pure 64bit operating system.

People, there's a saying: "use the right tool for the right job."

I believe that the best way to build 32bit programs is obviously a 32bit operating system. Either ran on bare-metal, or in a LXC container, or a virtual machine. And there's always for you the Slackware 32bit.

And for running particular 32bit programs (specially those which heavily use integers) with max performance, there's always for you the variant of using 64bit kernels on Slackware 32bit.

But another saying is "for someone who has a hammer, everything looks like a nail"

Last edited by Darth Vader; 07-08-2018 at 09:54 AM.
 
2 members found this post helpful.
Old 07-08-2018, 10:04 AM   #217
ZhaoLin1457
Senior Member
 
Registered: Jan 2018
Posts: 1,042

Rep: Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250
Speaking of using 64bit kernels on the Slackware 32bit, you have an explanation why apparently entire OS behave better and not only the OP's test program?

I was so much impressed by performance differences, that I consider to leave that box on using them as is. TBH, I do not need to build custom kernel modules for it.
 
Old 07-08-2018, 10:37 AM   #218
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
Quote:
Originally Posted by Darth Vader View Post
I fail to understand WHY someone will insists to build 32bit programs on a pure 64bit operating system.
This has been explained in depth, if you are not willing to read the thread then do not post. This is another example of why you are only capable of worthless trolling.
 
2 members found this post helpful.
Old 07-08-2018, 10:41 AM   #219
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Well, first of all, the SMP kernels form Slackware 32bit uses PAE, which essentially is the usage of a table with addresses of chunks of memory. This table permits to kernels to use up to 64GB memory instead of 4GB, but introduce some additional processing.

Compared with the 32bit kernels and their PAE, the 64bit kernels use so called "linear addressing", then they does not need to translate and re-translate memory locations, via a whatever table of chunks. Then they are a bit faster.

And another advantage is that they can use memory with size beyond 64GB. Not so important in the past, but today can happen your server to have 256GB memory and to have the need to use a 32bit operating system, because some proprietary application suite.

BUT, that PAE v.s Linear does not explain the differences observed with the test program suggested by @a4z. Rather, it explains why our BDFL observes slightly better performances of 64bit OS on his benchmarks.

What happens with this test program?

For simplification, let's imagine that an "integer" could be defined by a number from 0000 to 9999 (4 decimal digits) and that a 32bit CPU register or a memory location can contain exactly that number with 4 digits.

How you put 4 "integers" in memory, in this case? Sequentially.

1111
2222
3333
4444

Now, let's imagine that the 64bit has a double width, from 0000000 to 99999999, both as CPU registers, memory locations and "integers".

How you put exactly these 4 "integers" in memory, in this case? Of course, sequentially.

00001111
00002222
00003333
00004444

You will observe that apparently the CPU do the same job but the length of data differ. And that apparently a part of memory bits is not used.

Then, the brilliant minds behind compilers had an idea for static data: packing it to use the unused part when the records are smaller than registers width.

It is about something like:

11112222
33334444

Obviously, writing and reading TWO memory locations is considerable faster than reading and writing FOUR.

How in a 32bit operating system, the "integers" has 32bit length, when the kernel (and CPU) is 64bit, it is possible to use this records packing, resulting in a faster execution.

Which programs benefits from this records packing? Any programs which does not intend to manipulate this data, just to load it and read it.

For example, to compute a logarithmic sum of those integers. OR to load in memory tons of images, like Firefox do for its web-pages. OR even the compositing game done by a window manager, which is all about pixmaps put all the times back and forth.

Long story short, some applications can heavily benefit from this combination of a 64bit kernel and a 32bit operating system.

Last edited by Darth Vader; 07-08-2018 at 01:41 PM.
 
2 members found this post helpful.
Old 07-08-2018, 10:42 AM   #220
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Original Poster
Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
Quote:
Originally Posted by kjhambrick View Post
Hmmm ... yes, I understand cross-compilation ... But ... I thought this was about the Intel 32-bit Architecture ...

1. A Slackware64 System with a cross-compilation toochain doesn't sound like a pure Slackware64 System ... ( ? maybe just semantics at work here ? )

2. the only cross-compiler that I know of for compiling, linking and running 32-bit programs on a pure Slackware64 System is Alien Bob's Multilib system ... ( I am sure there are other ways to do it but Multilib is certainly the most convenient way to do it )

HTH.

-- kjh
don't take these guy serious, he doesn't understand the difference between a cross compiler and a multilib compiler, but he manages to have the brain acrobatic to be against inclusion of multilib compiler in 64bit Slackware but he thinks that 'optional 64bit kernel for Slackware 32bit is a interesting suggestion for improvements.' #206

Darth Vader is agains multilib, talks about alternatives that are all no alternatives, just to destroy any useful discussion

and jakep says my example, from which I said it is obvious that is is faster, is not an example for anything because it is obvious that such code is faster on 64 bit if compiled with32 bit, just to produce poison and make noise in this thread and be able to troll arround, togheter with Darth and ZahoLin

and I got friction points for the same post 2 times in a row, still don;t know why 2 times, but the trolls that mess up this and other threads with undoable or wrong techical info or pure nonsens and/or provocations are allowed to continue spread their mess in this place.

meanwhile, the person who maintains the multilib compiler that has so many user here has the following on his blog
https://alien.slackbook.org/blog/indisposed/

which is an other prove why multilib compiler should be available by default and not via a 3rd party repo, but of course just for those who understand what it is and wherefore it is used, and the persons who made the most noise in this thread, namely Darth Vader, jakep and ZhaoLin1457 are not in this group, they are trolls that want to destroy every topic and discussion here they don't understand.

sad to see to what this place became, no wonder that on Linus conferences and other places Linux devs and other people get a slightly grin on their face when the topic comes to Slackware

actually, this topic is final discussed, I think an admin should close this thread

Last edited by a4z; 07-08-2018 at 11:16 AM.
 
Old 07-08-2018, 10:46 AM   #221
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Quote:
Originally Posted by a4z View Post
Darth Vader is agains multilib, talks about alternatives that are all no alternatives, just to destroy any useful discussion
See my previous post about a tentative of explanation on layman terms about what happens, and why some 32bit programs tend to behave faster under a 64bit kernel.

The people who spread misinformation are the ones who claims about magics behind "-m32" flag. There's not such thing. The magic is elsewhere.

Last edited by Darth Vader; 07-08-2018 at 10:52 AM.
 
2 members found this post helpful.
Old 07-08-2018, 10:54 AM   #222
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Quote:
Originally Posted by a4z View Post
don't take this guy serious, he doesn't understand the difference between a cross compiler and a multilib compiler, but he manages to have the brain acrobatic to be against inclusion of multilib compiler in 64bit Slackware but he thinks that 'optional 64bit kernel for Slackware 32bit is a interesting suggestion for improvements.' #206

<<snip>>
a4z --

I believe you've got me mixed up with someone else ( #206 ).

But would you not say that Alien Bob's Multilib System provides a cross-compiler ?

I do because I use it that way to cross-compile Intel 32-bit programs on my Intel 64-bit system.

And as far as automatically installing Multilib ... even RedHat makes Multilib optional via the compatibility libraries ...

YMMV ...

-- kjh
 
1 members found this post helpful.
Old 07-08-2018, 11:07 AM   #223
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,379

Rep: Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757
Quote:
actually, this topic is final discussed, I think an admin should close this thread
Reported with a request that this thread be locked.
 
1 members found this post helpful.
Old 07-08-2018, 11:08 AM   #224
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Quote:
Originally Posted by kjhambrick View Post
And as far as automatically installing Multilib ... even RedHat makes Multilib optional via the compatibility libraries ...
Yeah, man! RedHat gives you Multilib optionally.

BUT, also it gives you the RPM package manager, and automatically dependencies tracking. It also, gives you LinuxPAM and Kerberos. And I kept best one for the last: SystemD

Did you really believe that Patrick Volkerding should to exactly what RedHat do?
 
Old 07-08-2018, 11:09 AM   #225
ZhaoLin1457
Senior Member
 
Registered: Jan 2018
Posts: 1,042

Rep: Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250
Quote:
Originally Posted by allend View Post
Reported with a request that this thread be locked.
What is wrong on discussing about the advantages of using 64bit kernels on Slackware 32bit?
 
2 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu 32-bit Future? wagscat123 Ubuntu 3 11-03-2016 10:18 AM
LXer: GNU/Hurd Plans For A Future With USB, SATA, 64-Bit LXer Syndicated Linux News 0 02-10-2013 04:01 AM
How important is 64-bit support in future Slackware? wheeliee Slackware 36 03-25-2009 05:34 AM
LXer: Desktop FreeBSD: 64-bit Future LXer Syndicated Linux News 1 10-06-2006 11:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration