LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-18-2016, 09:03 PM   #1
niteshadw
Member
 
Registered: Sep 2002
Distribution: CentOS
Posts: 170

Rep: Reputation: 15
ld is missing files...


Hello,

I'm trying to compile efitools on CentOS but I am running into an issue. This is what the error I get during make:

Code:
# make
make -C lib lib-efi.a
make[1]: Entering directory `/root/efitools/lib'
make[1]: `lib-efi.a' is up to date.
make[1]: Leaving directory `/root/efitools/lib'
cc -I/root/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2  -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c HelloWorld.c -o HelloWorld.o
ld -nostdlib -shared -Bsymbolic /usr/lib64/gnuefi/crt0-efi-x86_64.o -L /usr/lib64/gnuefi -T elf_x86_64_efi.lds HelloWorld.o lib/lib-efi.a -o HelloWorld.so -lefi -lgnuefi /usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc.a
ld: cannot find -lefi
ld: cannot find -lgnuefi
make: *** [HelloWorld.so] Error 1
rm HelloWorld.o
However it seems I have libefi and libgnuefi:

Code:
# locate libefi
/usr/lib64/libefi.a
/usr/lib64/libefivar.so.0
# locate libgnuefi
/usr/lib64/libgnuefi.a
I'm not sure what I am missing? I installed the gnu-efi-devel package and based on my searches, ld searches for *.a but maybe the files need to be *.so?

Any suggestions would be much appreciated.
 
Old 11-19-2016, 05:44 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
You are right. For normal dynamic linking you would need .so files. The .a files are for static linking only.

Devel packages do not contain the actual dynamic libraries. You will need to install them separately. Actually I'm surprised that they didn't come over as dependencies of their headers.
 
Old 11-19-2016, 09:05 AM   #3
niteshadw
Member
 
Registered: Sep 2002
Distribution: CentOS
Posts: 170

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by hazel View Post
You are right. For normal dynamic linking you would need .so files. The .a files are for static linking only.

Devel packages do not contain the actual dynamic libraries. You will need to install them separately. Actually I'm surprised that they didn't come over as dependencies of their headers.
Thank you for your reply, but I'm not sure what I'm missing...

I have the efi and gnuefi packages installed:

Code:
# rpm -qa | grep -i efi
efibootmgr-0.8.0-7.el7.x86_64
gnu-efi-3.0.2-2.el7.x86_64
gnu-efi-devel-3.0.2-2.el7.x86_64
efivar-libs-0.11-1.el7.x86_64
grub2-efi-2.02-0.29.el7.centos.x86_64


# rpm -ql gnu-efi-3.0.2-2.el7.x86_64
/usr/lib64/gnuefi
/usr/lib64/gnuefi/crt0-efi-x86_64.o
/usr/lib64/gnuefi/elf_x86_64_efi.lds
/usr/lib64/libefi.a
/usr/lib64/libgnuefi.a


# rpm -ql gnu-efi-devel-3.0.2-2.el7.x86_64
/usr/include/efi
/usr/include/efi/efi.h
/usr/include/efi/efi_nii.h
/usr/include/efi/efi_pxe.h
/usr/include/efi/efiapi.h
/usr/include/efi/eficon.h
/usr/include/efi/efidebug.h
/usr/include/efi/efidef.h
/usr/include/efi/efidevp.h
/usr/include/efi/efierr.h
/usr/include/efi/efifs.h
/usr/include/efi/efigpt.h
/usr/include/efi/efiip.h
/usr/include/efi/efilib.h
/usr/include/efi/efilink.h
/usr/include/efi/efinet.h
/usr/include/efi/efipart.h
/usr/include/efi/efipciio.h
/usr/include/efi/efipoint.h
/usr/include/efi/efiprot.h
/usr/include/efi/efipxebc.h
/usr/include/efi/efirtlib.h
/usr/include/efi/efiser.h
/usr/include/efi/efishellintf.h
/usr/include/efi/efishellparm.h
/usr/include/efi/efistdarg.h
/usr/include/efi/efitcp.h
/usr/include/efi/efiudp.h
/usr/include/efi/efiui.h
/usr/include/efi/libsmbios.h
/usr/include/efi/pci22.h
/usr/include/efi/protocol
/usr/include/efi/protocol/adapterdebug.h
/usr/include/efi/protocol/eficonsplit.h
/usr/include/efi/protocol/efidbg.h
/usr/include/efi/protocol/efivar.h
/usr/include/efi/protocol/intload.h
/usr/include/efi/protocol/legacyboot.h
/usr/include/efi/protocol/piflash64.h
/usr/include/efi/protocol/vgaclass.h
/usr/include/efi/romload.h
/usr/include/efi/x86_64
/usr/include/efi/x86_64/efibind.h
/usr/include/efi/x86_64/efilibplat.h
/usr/include/efi/x86_64/pe.h
/usr/share/doc/gnu-efi-devel-3.0.2
/usr/share/doc/gnu-efi-devel-3.0.2/ChangeLog
/usr/share/doc/gnu-efi-devel-3.0.2/README.efilib
/usr/share/doc/gnu-efi-devel-3.0.2/README.elilo
/usr/share/doc/gnu-efi-devel-3.0.2/README.git
/usr/share/doc/gnu-efi-devel-3.0.2/README.gnuefi
 
Old 11-19-2016, 11:15 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
I was wrong. I've been browsing around and it seems that efi programs are statically linked after all, which is why no dynamic library objects are provided. I've looked at examples of Hello World programs being built for efi and they seem to use the same ld flags as you do, so I don't know why your static libraries weren't found. I hope someone else picks this up as I seem to have done you a bad turn by taking away your "zero reply" flag.
 
Old 11-20-2016, 05:00 PM   #5
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Try the following:
Code:
/usr/lib64# ln -s gnuefi/crt0-efi-x86_64.o
/usr/lib64# ln -s gnuefi/elf_x86_64_efi.lds
On my Debian box those two files are in the same directory as the static libs.
 
  


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
Creating a large tar ile form a sequence of small tar files and one files is missing jyunker Linux - Newbie 4 03-10-2015 02:56 PM
Help listing installed files and searching for missing files mightymouse2045 Linux - General 3 10-09-2013 07:57 PM
Linux header files missing and v4l files unable to compile szutshi Linux - Newbie 5 09-13-2011 02:00 PM
Some missing files Gins Linux - General 6 06-23-2006 02:09 PM
missing files waqer Mandriva 5 12-25-2004 04:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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