LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 02-05-2021, 12:49 PM   #16
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,625

Rep: Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346

Quote:
Originally Posted by sndwvs View Post
there is a difference, in slarm64, as well as in slackware64, the interpreter is located in /lib64,
You're right! That's funny because I would have sworn that Slackware64 had a symlink in /lib too, but I must have confused myself as I was studying all three architectures in one sitting. The default with glibc on aarch64 is /lib though - it's unaffected by the configuration options. I'll take the defaults with that one.
 
Old 02-05-2021, 12:55 PM   #17
sndwvs
Senior Member
 
Registered: Aug 2014
Posts: 2,123

Rep: Reputation: Disabled
Quote:
Originally Posted by drmozes View Post
You're right! That's funny because I would have sworn that Slackware64 had a symlink in /lib too, but I must have confused myself as I was studying all three architectures in one sitting. The default with glibc on aarch64 is /lib though - it's unaffected by the configuration options. I'll take the defaults with that one.
yes, it is, but the configuration only gives where the libraries will be located in lib or lib64, but the interpreter will still refer to /lib/ld-linux-aarch64.so.1 this compiler gives this setting when compiling .
 
Old 02-05-2021, 05:46 PM   #18
0XBF
Member
 
Registered: Nov 2018
Distribution: Slackware
Posts: 903

Rep: Reputation: 1084Reputation: 1084Reputation: 1084Reputation: 1084Reputation: 1084Reputation: 1084Reputation: 1084Reputation: 1084
Thanks for continuing the discussion, I'm learning some new things here like "patchelf".

I am trying to piece together the story here and I am nowhere near the level of understanding of you two so bear with me...

First, the armv8 plex .deb build from plex.tv is 64bit software. I have checked it with readelf and it reports it as such:
Code:
bob@rockpro64:~$ readelf -h /usr/lib/plexmediaserver/Plex\ Media\ Server
ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           AArch64
  Version:                           0x1
  Entry point address:               0x9b0000
  Start of program headers:          64 (bytes into file)
  Start of section headers:          24115208 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         11
  Size of section headers:           64 (bytes)
  Number of section headers:         34
  Section header string table index: 33
However it is looking for the interpreter in /lib, as sndwvs says:
Code:
bob@rockpro64:~$ patchelf --print-interpreter /usr/lib/plexmediaserver/Plex\ Media\ Server 
/lib/ld-linux-aarch64.so.1
So that would be why that symlink fixes it. The funny thing is that on my x86_64 machine with the plex.tv x86_64 version of the .deb package they have the interpreter set right:
Code:
bob@slackbox:~$ patchelf --print-interpreter /usr/lib/plexmediaserver/Plex\ Media\ Server 
/lib64/ld-linux-x86-64.so.2
I guess that would be due to differences in build machine configuration? I would prefer to build plex myself but the code is closed and they only release .deb packages.

@ sndwvs:
With your second fix you listed, does that "find" command change the interpreter in the already installed binaries? i.e. you would run that against plex's binaries? I guess that could be used as a "patch" in the slackbuild to correct the interpreter before installing. Thanks for the info.
 
Old 02-05-2021, 06:03 PM   #19
sndwvs
Senior Member
 
Registered: Aug 2014
Posts: 2,123

Rep: Reputation: Disabled
Quote:
Originally Posted by 0XBF View Post
So that would be why that symlink fixes it. The funny thing is that on my x86_64 machine with the plex.tv x86_64 version of the .deb package they have the interpreter set right:
Code:
bob@slackbox:~$ patchelf --print-interpreter /usr/lib/plexmediaserver/Plex\ Media\ Server 
/lib64/ld-linux-x86-64.so.2
I guess that would be due to differences in build machine configuration? I would prefer to build plex myself but the code is closed and they only release .deb packages.
no just for x86_64 this is the default behavior when building gcc:
Code:
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
for aarch64:
Code:
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
Quote:
Originally Posted by 0XBF View Post
@ sndwvs:
With your second fix you listed, does that "find" command change the interpreter in the already installed binaries? i.e. you would run that against plex's binaries? I guess that could be used as a "patch" in the slackbuild to correct the interpreter before installing. Thanks for the info.
In any folder you direct find to by replacing dot with the path to the files.

Last edited by sndwvs; 02-05-2021 at 06:05 PM.
 
Old 02-05-2021, 08:18 PM   #20
0XBF
Member
 
Registered: Nov 2018
Distribution: Slackware
Posts: 903

Rep: Reputation: 1084Reputation: 1084Reputation: 1084Reputation: 1084Reputation: 1084Reputation: 1084Reputation: 1084Reputation: 1084
I had to change
Code:
find . | xargs file | ...
to
Code:
find . | xargs -d '\n' file | ...
because the problem files in /usr/lib/plexmediaserver all use spaces in the file names which was preventing them from being found. Now that fix works fine.

If anyone else is looking to install plex then here's the diff patch from my modified plexmediaserver.SlackBuild and the one on ponce's repo. This builds a working plex install (for aarch64), assuming you grab the appropriate .deb download from plex.tv

Code:
--- plexmediaserver.SlackBuild.old      2021-02-05 18:56:49.466642560 -0600
+++ plexmediaserver.SlackBuild.new      2021-02-05 19:03:04.130919996 -0600
@@ -58,6 +58,10 @@
   DEBARCH="amd64"
   LIBDIRSUFFIX="64"
   ARCH="x86_64"
+elif [ "$ARCH" = "aarch64" ]; then
+  DEBARCH="arm64"
+  LIBDIRSUFFIX="64"
+  ARCH="aarch64"
 else
   echo "Package for $(uname -m) architecture is not available."
   exit 1
@@ -109,6 +113,11 @@
 mkdir -p $PKG/usr/lib/
 mv usr/lib/plexmediaserver $PKG/usr/lib
 
+# Fix the interpreter path for aarch64 targets:
+if [ "$ARCH" = "aarch64" ]; then
+  find $PKG/usr/lib | xargs -d '\n' file | grep -e "executable\(.*\)interpreter" | grep ELF | cut -f1 -d ':' | xargs -I '{}' patchelf --set-interpreter /lib64/ld-linux-aarch64.so.1 '{}'
+fi
+
 mkdir -p $PKG/usr/share/applications/
 mv usr/share/applications/plexmediaserver.desktop $PKG/usr/share/applications
 sed -i -e "s/x-www-browser/xdg-open/" $PKG/usr/share/applications/plexmediaserver.desktop

Last edited by 0XBF; 02-05-2021 at 08:29 PM.
 
  


Reply

Tags
arm, plexmediaserver


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: Review Plex Media Server For Linux, Sync Media Across All Of Your Devices LXer Syndicated Linux News 0 02-29-2016 01:51 PM
Plex Media Server on Slackware64 Gee Man Slackware 1 10-01-2012 07:12 PM
LXer: Plex Media Server + Roku = Awesome LXer Syndicated Linux News 0 08-27-2012 01:30 PM
LXer: Plex Media Server + Roku = Awesome LXer Syndicated Linux News 0 08-13-2012 06:20 PM

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

All times are GMT -5. The time now is 05:15 AM.

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