You are not logged in.

#1 2019-09-28 21:20:19

NumeroSMG
Member
Registered: 2016-08-23
Posts: 25

32-bit application (game) asking for libc++.so.1

Specifically it is a mod for a game Hearts of Iron IV.
Vanilla game starts and runs just fine - it's native for linux.
When I tried to run the game with the mod installed it started crashing and looking for libc++.so.1

error while loading shared libraries: libc++.so.1: cannot open shared object file: No such file or directory

After I linked it from /usr/lib (and from /usr/lib64, same effect, and it's not in the /usr/lib32), it gave me:

$ LD_LIBRARY_PATH=/usr/local/lib
$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib
$ export LD_LIBRARY_PATH
$ ./start
error while loading shared libraries: libc++.so.1: wrong ELF class: ELFCLASS64

I got the library from https://aur.archlinux.org/packages/libc%2B%2B/ (may have already had it installed before, not sure)
and as far as I can tell it is available only in 64-bit? And I need 32-bit for the game to launch?
Is there anything that can be done about it, or maybe I am completely wrong here and missing something else?

Last edited by NumeroSMG (2019-09-28 21:23:28)

Offline

#2 2019-09-28 21:32:30

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: 32-bit application (game) asking for libc++.so.1

"After I linked it from /usr/lib"...

This sounds really bad. Undo whatever you did.

You need lib32-libc++, which I don't see already packaged. You also need whatever version provides that soname, I don't know if it's the latest or not.

Offline

#3 2019-09-28 21:39:48

NumeroSMG
Member
Registered: 2016-08-23
Posts: 25

Re: 32-bit application (game) asking for libc++.so.1

Scimmia wrote:

"After I linked it from /usr/lib"...

This sounds really bad. Undo whatever you did.

Maybe "linking" is an incorrect term, sorry, what I did was I used the following code, to specify where it should look for the library prior to attempting to start the game:

$ LD_LIBRARY_PATH=/usr/local/lib
$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib
$ export LD_LIBRARY_PATH
$ ./start

It seems to undo every time I close the terminal.

Last edited by NumeroSMG (2019-09-28 21:42:26)

Offline

#4 2019-09-28 21:49:49

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: 32-bit application (game) asking for libc++.so.1

Both of those are in the linker search path already, so it essentially does nothing. As you said, it's gone when you close the terminal anyway. Usually when people talking about linking in /usr/lib/, they're making symlinks to wrong things.

Offline

#5 2019-09-28 23:31:53

NumeroSMG
Member
Registered: 2016-08-23
Posts: 25

Re: 32-bit application (game) asking for libc++.so.1

I am now reading into the game itself, and it seems like the game is now fully 64-bit supported.

...Because of this we have decided to up the big decimal on our version number to 1.7. 1.7 ‘Hydra’ will be fully 64-bit supported on Linux, Mac and Windows and it has been a big undertaking. ...

Taken from the official game's forum, and I am running the correct game version.
If that was the case, shouldn't I have no issues using 64-bit libc++?

Offline

#6 2019-09-28 23:38:01

loqs
Member
Registered: 2014-03-06
Posts: 19,100

Re: 32-bit application (game) asking for libc++.so.1

Is the mod 64bit?

lib32-libc++ build tested only

# Maintainer: Llewelyn Trahaearn <woefulderelict [at] gmail [dot] com>
# Contributor: Daniel Micay <danielmicay [at] gmail [dot] com>
# Contributor: MThinkCpp <mtc [dot] maintainer [at] outlook [dot] com>

pkgbase=lib32-libc++
pkgname=(${pkgbase}{,abi,experimental})
pkgver=8.0.1
pkgrel=1
url="https://libcxx.llvm.org/"
license=('MIT' 'custom:University of Illinois/NCSA Open Source License')
arch=('x86_64')
depends=('lib32-gcc-libs')
makedepends=('clang' 'cmake' 'ninja' 'python' 'libunwind')
source=("https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/llvm-$pkgver.src.tar.xz"{,.sig}
        "https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/libcxx-$pkgver.src.tar.xz"{,.sig}
        "https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/libcxxabi-$pkgver.src.tar.xz"{,.sig})
noextract=("${source[@]##*/}")
sha512sums=('82e120be5cabdfd5111aebbea68a663fe229c8861d73802d6ab09a3bf48f60de333e07e61f8fb61beaa14ac2bea24fcd74fa6f761acaf62469f536b79fcb1e16'
            'SKIP'
            '75749d08b2b343c6f5f9aefb04be63e42f6d12efc51101d3647ed6f70c7a6d050afb3ab2f3636eae78cb523f5844de67b960a7a3145ed89ab0c7015deb14921e'
            'SKIP'
            '577cfcb04ebb29ee84d35ed31aa8fecb28fc74b07ef7ff298f0fe2d440f823def73e092359c41d8d8600e6df18f55224ed89674d403c5ae56a7d7973487b8734'
            'SKIP')
validpgpkeys=('474E22316ABF4785A88C6E8EA2C794A986419D8A') # Tom Stellard <tstellar@redhat.com> (.1 releases)
validpgpkeys+=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg <hans@chromium.org> (.0 releases)
 
prepare() {
  mkdir -p build llvm/projects/libcxx llvm/projects/libcxxabi
  bsdtar --strip-components 1 -zxf "${source[0]##*/}" -C llvm
  bsdtar --strip-components 1 -zxf "${source[2]##*/}" -C llvm/projects/libcxx
  bsdtar --strip-components 1 -zxf "${source[4]##*/}" -C llvm/projects/libcxxabi
  sed -i 's/CREDITS.TXT/CREDITS/' llvm/projects/libcxx/LICENSE.TXT llvm/projects/libcxxabi/LICENSE.TXT
}
 
build() {
  cd build
  cmake \
    -G Ninja \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_C_COMPILER=clang \
    -DCMAKE_CXX_COMPILER=clang++ \
    -DLIBCXX_INSTALL_EXPERIMENTAL_LIBRARY=NO \
    -DLIBCXX_INSTALL_FILESYSTEM_LIBRARY=NO \
    -DLLVM_LIBDIR_SUFFIX=32 \
    -DCMAKE_C_FLAGS:STRING=-m32 \
    -DCMAKE_CXX_FLAGS:STRING=-m32 \
    "$srcdir"/llvm
  ninja cxx cxx_experimental cxx_filesystem
}

check() {
  cd build
#  ninja check-cxx check-cxxabi
}

package_lib32-libc++() {
  pkgdesc='LLVM C++ standard library.'
  depends=("lib32-libc++abi=$pkgver-$pkgrel")
  options=('staticlibs')

  cd build
  DESTDIR="$pkgdir" ninja install-libcxx
  rm -rf "$pkgdir"/usr/include

  # License.
  install -Dm0644 "$srcdir"/llvm/projects/libcxx/CREDITS.TXT "$pkgdir"/usr/share/licenses/"$pkgname"/CREDITS
  install -Dm0644 "$srcdir"/llvm/projects/libcxx/LICENSE.TXT "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}
 
package_lib32-libc++abi() {
  pkgdesc='Low level support for the LLVM C++ standard library.'
  options=('staticlibs')
  
  cd build
  DESTDIR="$pkgdir" ninja install-libcxxabi
  install -Dm0644 "$srcdir"/llvm/projects/libcxxabi/CREDITS.TXT "$pkgdir"/usr/share/licenses/"$pkgname"/CREDITS
  install -Dm0644 "$srcdir"/llvm/projects/libcxxabi/LICENSE.TXT "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}
 
package_lib32-libc++experimental() {
  depends=("lib32-libc++=$pkgver-$pkgrel")
  pkgdesc='LLVM C++ experimental library.'
  
  install -Dm0644 -t "$pkgdir"/usr/lib/ build/lib32/libc++experimental.a build/lib32/libc++fs.a
  install -Dm0644 llvm/projects/libcxx/CREDITS.TXT "$pkgdir"/usr/share/licenses/"$pkgname"/CREDITS
  install -Dm0644 llvm/projects/libcxx/LICENSE.TXT "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}

Offline

#7 2019-09-28 23:44:00

NumeroSMG
Member
Registered: 2016-08-23
Posts: 25

Re: 32-bit application (game) asking for libc++.so.1

loqs wrote:

Is the mod 64bit?

The mod explicitly states that it required game version 1.7.x - the version which apparently runs the game in 64-bit, so I would assume that yes.

Offline

#8 2019-09-28 23:44:55

loqs
Member
Registered: 2014-03-06
Posts: 19,100

Re: 32-bit application (game) asking for libc++.so.1

If you run file on the mod does it as 64 bit?

Offline

#9 2019-09-29 11:08:51

NumeroSMG
Member
Registered: 2016-08-23
Posts: 25

Re: 32-bit application (game) asking for libc++.so.1

loqs wrote:

If you run file on the mod does it as 64 bit?

Not sure what you are asking.
However, I tried building lib32-libc++ you provided, and the game crashes without any linux specific errors, only generating game-crash report.
Here are metadata from that crash report:

# Crash Information
AppName: HOI4 
AppVersion: Hydra v1.7.1 
SCMBranch: stable 
SCMCommit: 5a9265ee2fa09e1885e58a22d5fafd2b95dcf0d2 
SCMTimeStamp: "2019-06-24 11:51:06 +0200" 
DateTime: "2019-09-29 01:53:14" 
BuildType: Release 
Platform: Linux 
Architecture: 32-bit 
OperatingSystem: Linux 5.1.6-arch1-1-ARCH x86_64 
SystemLanguage: unknown 
CPUModel: Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz 
CPUSpeed: 2025 
CPUPhysicalCores: 2 
CPULogicalCores: 4 
SystemMemory: 7859 

# Application Specific Data 
"Test Data": Test Value 

Notice the Architecture: 32-bit , I'm really confused. I couldn't find anything else what would suggest why is it crashing though.
I have tested the same game version (but Windows-native) and mod version on my Windows PC and it runs fine.

Last edited by NumeroSMG (2019-09-29 11:12:07)

Offline

#10 2019-09-29 11:21:41

loqs
Member
Registered: 2014-03-06
Posts: 19,100

Re: 32-bit application (game) asking for libc++.so.1

The mod supplies some file(s) I assume.  `file path/to/file/for/mod`

Offline

#11 2019-09-30 04:47:22

grinner
Member
Registered: 2019-06-28
Posts: 28

Re: 32-bit application (game) asking for libc++.so.1

NumeroSMG wrote:

I have tested the same game version (but Windows-native) and mod version on my Windows PC and it runs fine.

Often mods are only compatible with the windows version of a game.  Check/report the file paths as loqs recommends and compare to the files for native and windows versions of the game.  If this is the case then the options are either playing the mod with a windows version of the game (HOI IV reportedly works well with steamplay/Proton, assuming you have a steam registered version) or porting the mod to linux.  The difficulty of the latter varies depending on mod itself and what it does/the changes it makes. Contacting the author(s) of the mod is also an option.

Offline

Board footer

Powered by FluxBB