LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 10-02-2019, 10:04 AM   #1
bryan_S
Member
 
Registered: Aug 2014
Location: N. Florida
Distribution: Linux-from-Scratch
Posts: 113

Rep: Reputation: Disabled
Cant build gobject-introspection


Decided to build new system (svn as of 2019-09-23) and try out non-systemd version with logind + pam. I've never built gobject-introspection before because i never build gnome, but, with current libsecret and upcoming version of gimp requiring it, i tried to include it. It always fails with following:

Code:
Traceback (most recent call last):		[gobject-introspection]
  File "tools/g-ir-scanner", line 100, in <module>
    sys.exit(scanner_main(sys.argv))
  File "/root/gobject-introspection-1.62.0/build/giscanner/scannermain.py", line 579, in scanner_main
    shlibs = create_binary(transformer, options, args)
  File "/root/gobject-introspection-1.62.0/build/giscanner/scannermain.py", line 419, in create_binary
    shlibs = resolve_shlibs(options, binary, options.libraries)
  File "/root/gobject-introspection-1.62.0/build/giscanner/shlibs.py", line 168, in resolve_shlibs
    _resolve_non_libtool(options, binary, non_libtool))
  File "/root/gobject-introspection-1.62.0/build/giscanner/shlibs.py", line 104, in _resolve_non_libtool
    output = subprocess.check_output(args)
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ldd', '/root/gobject-introspection-1.62.0/build/tmp-introspectu_km3xvs/GLib-2.0']' returned non-zero exit status 1.
ninja: build stopped: subcommand failed
Looks likes a python issue? I see a 'ldd' at the bottom and that doesn't seem to work on my system. Eg. ldd /usr/bin/less yields "not a dynamic executable" - and same for libraries. Right now, I could live without introspection, except, I cant apply the elogind patch to polkit because when running autoreconf -fi after applying the patch IT complains about missing gir (grrr.)
 
Old 10-03-2019, 04:31 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,453

Rep: Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342
Ignore the long tailspin and focus on the error. The rest of the tailspin doesn't matter.
Code:
subprocess.CalledProcessError: Command '['ldd', '/root/gobject-introspection-1.62.0/build/tmp-introspectu_km3xvs/GLib-2.0']' returned non-zero exit status 1.
Error 1 is permissions. You can look them up in /usr/include/asm-generic/errno.h & errno-base.h or some such files. Handy when sorting compiles.

My guess is that (/root/…<blah>…/GLib-2.0 a directory, not an executable, so ldd would understandably puke. It may be compile-time options. When I considered building gnome in BLFS back a long time ago, everyone was bitching about dependencies. I hope it's not that way still. But if you're doing SVN, you obviously enjoy suffering
 
Old 10-03-2019, 08:51 AM   #3
bryan_S
Member
 
Registered: Aug 2014
Location: N. Florida
Distribution: Linux-from-Scratch
Posts: 113

Original Poster
Rep: Reputation: Disabled
That path is just where I'm building it. In that case, as root, in /root. But, I've also tried as a regular user in ~ and with the package manager (which sets CFLAGS). Same result in all cases. I don't think much has changed since 9.0 was released - same toolchain, same glibc. I will see if i can get a newer g-introspection package to try if nothing else works.
 
Old 10-04-2019, 04:21 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,453

Rep: Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342
You're running ldd on a directory. ldd just throws up an output onscreen of required libs. I would imagine in a compile you'd want to be running ld (the linker) and not ldd. What is in that location anyhow?
 
Old 10-04-2019, 09:00 AM   #5
bryan_S
Member
 
Registered: Aug 2014
Location: N. Florida
Distribution: Linux-from-Scratch
Posts: 113

Original Poster
Rep: Reputation: Disabled
It has something to do with how I a build glibc. The problem was the non-functioning ldd command. I hadn't noticed it before because I don't run the tests, all the sanity checks passed, and no other packages complained. I managed to get a working ldd by rebuilding glibc on a test system (same toolchain and packages) and then was able to get gobject-introspection to build. Not completely solved because glibc put stuff in the /lib64 folder, so I've still got some work to do, but I'll figure it out.
 
Old 10-04-2019, 04:35 PM   #6
bryan_S
Member
 
Registered: Aug 2014
Location: N. Florida
Distribution: Linux-from-Scratch
Posts: 113

Original Poster
Rep: Reputation: Disabled
It turns out i didn't need to rebuild anything. The ldd script couldn't find the linker. A sed on /usr/bin/ldd would fix it i think, but i just created a symlink (this is a non-multilib system):

Quote:
# ldd /usr/bin/less
not a dynamic executable

# ln -s ld-2.30.so /usr/lib/ld-linux.so.2

# ldd /usr/bin/less
linux-vdso.so.1 (0x00007fffce5fb000)
libncursesw.so.6 => /usr/lib/libncursesw.so.6 (0x00007f9492740000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f9492578000)
/lib64/ld-linux-x86-64.so.2 => /usr/lib/ld-linux.so.2 (0x00007f94927d0000)
So, in summary: polkit w/ patch requires gobject-introspection which requires working ldd to build. Now i can fix polkit and (of less importance to me) rebuild the gtk stack with gir support.
 
Old 10-07-2019, 05:28 PM   #7
shevegen
Member
 
Registered: May 2004
Distribution: Slackware / GoboLinux / LFS / VoidLinux
Posts: 145

Rep: Reputation: 26
Very interesting - bryan_S you actually solved the same issue I had.

For months I could not compile gobject-introspection and ldd was
always failing. Then I noticed that, indeed, ldd was not even working;
and then, also, yup, the ld*linux* was missing.

It would be nice if LFS/BLFS could mention this specifically. Anyone
with connections to the LFS/BLFS guys? That could definitely help
other people too.
 
Old 10-08-2019, 03:57 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,453

Rep: Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342Reputation: 2342
Yeah, that's a real niusance. Part of LSB compliance. And errors on that lib don't throw standard library-type errors either.
 
Old 07-13-2023, 10:44 AM   #9
jhermans
LQ Newbie
 
Registered: Aug 2004
Posts: 6

Rep: Reputation: 0
Thumbs up

Sorry to necro an old thread, but the same problem just happened to me while building LFS/BLFS. It's entirely possible that I made a mistake setting up the system initially -- there are quite a lot of manual steps.

Thank you for the excellent advice and diagnosis of the issue with ldd. After realizing that the gobject-introspection build was indeed running ldd on a directory, and also that ldd was generally not working on any executable, I followed your advice.

However the command for me was slightly different. I am posting here in case it may be relevant for someone else later:

Code:
root:~$ ldd /usr/bin/less
not a dynamic executable

root:~$ ln -s ld-linux-x86-64.so.2 /usr/lib/ld-linux.so.2

root:~$ ldd /usr/bin/less
	linux-vdso.so.1 (0x00007ffd0ef90000)
	libncursesw.so.6 => /usr/lib/libncursesw.so.6 (0x00007f94180e5000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007f9417f04000)
	/lib64/ld-linux-x86-64.so.2 => /usr/lib/ld-linux.so.2 (0x00007f941819b000)
Thanks again.

Quote:
Originally Posted by bryan_S View Post
It turns out i didn't need to rebuild anything. The ldd script couldn't find the linker. A sed on /usr/bin/ldd would fix it i think, but i just created a symlink (this is a non-multilib system):



So, in summary: polkit w/ patch requires gobject-introspection which requires working ldd to build. Now i can fix polkit and (of less importance to me) rebuild the gtk stack with gir support.
 
  


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
[SOLVED] pygobject and gobject-introspection in -current audriusk Slackware 2 07-22-2012 11:16 AM
gobject-introspection package installation rmugunthan Linux - Server 0 07-16-2012 12:00 AM
gobject-introspection package installation rmugunthan Linux - Newbie 0 06-24-2012 11:15 PM
LXer: Rebuild Spice-Gtk-0.7 via Debian Unstable with gobject-introspection enabled LXer Syndicated Linux News 0 08-20-2011 11:21 PM
gobject-introspection-0.6.14 build blowing up ninja master Linux - Software 1 12-31-2010 01:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 04:58 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