Extracted the contents to "/home/$USER/Downloads/gptfdisk-0.8.10/uefi-0.2/gnu-efi-3.0" by running "tar -xvjf gnu-efi-3.0.1.tar.bz2 -C gptfdisk-0.8.10/uefi-0.2"
Changed to directory "/home/$USER/Downloads/gptfdisk-0.8.10/uefi-0.2" and ran the patch by running "./PATCH.sh" and the following was returned:
Patching ../gdisk.cc, inserting EFI define at line 19.
Patching ../gpt.cc, inserting EFI code at line 40.
Patching ../support.cc, inserting EFI code at line 232.
While still in the same directory "/home/$USER/Downloads/gptfdisk-0.8.10/uefi-0.2" I tried to build UEFI GPT fdisk by running "make", but instead the following was returned:
make -C gnu-efi-3.0 ARCH="x86_64"
make: *** gnu-efi-3.0: No such file or directory. Stop.
make: *** [gnu-efi-3.0/lib/libefi.a] Error 2
To fix this I had to change the line GNUEFI := gnu-efi-3.0 inside the Makefile to GNUEFI := gnu-efi-3.0.1 and then re-run "make" again. This time it starting building, but I'm not sure if it was successful or where the output of the build went.
This is a list of all the files I had in my "uefi-0.2" subfolder before running "make":
But I don't see any gdisk.efi or *.efi file. I'm still fairly new to building applications, so maybe I'm missing something obvious or doing something wrong?
Last edit: Keith J. 2015-02-24
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ar: creating libefi.a
hand.c: In function ‘LibLocateHandleByDiskSignature’:
hand.c:120:28: warning: variable ‘Start’ set but not used [-Wunused-but-set-variable]
hw.c: In function ‘ReadPort’:
hw.c:79:17: warning: variable ‘Status’ set but not used [-Wunused-but-set-variable]
hw.c: In function ‘WritePort’:
hw.c:94:17: warning: variable ‘Status’ set but not used [-Wunused-but-set-variable]
hw.c: In function ‘ReadPciConfig’:
hw.c:109:17: warning: variable ‘Status’ set but not used [-Wunused-but-set-variable]
hw.c: In function ‘WritePciConfig’:
hw.c:124:17: warning: variable ‘Status’ set but not used [-Wunused-but-set-variable]
ar: creating libgnuefi.a
ar: creating libmy.a
C-ctype.c:566:3: warning: missing initializer [-Wmissing-field-initializers]
C-ctype.c:566:3: warning: (near initialization for ‘_nl_C_LC_CTYPE.private.<anonymous>’) [-Wmissing-field-initializers]
In file included from localeinfo.h:17:0,
from newlocale.c:49:
libmy.h:84:0: warning: "__libc_lock_define" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:73:0: note: this is the location of the previous definition
libmy.h:85:0: warning: "__rtld_lock_define_recursive" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:79:0: note: this is the location of the previous definition
libmy.h:86:0: warning: "__libc_rwlock_define" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:75:0: note: this is the location of the previous definition
libmy.h:87:0: warning: "__libc_lock_lock" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:258:0: note: this is the location of the previous definition
libmy.h:88:0: warning: "__libc_rwlock_rdlock" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:261:0: note: this is the location of the previous definition
libmy.h:89:0: warning: "__libc_rwlock_wrlock" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:263:0: note: this is the location of the previous definition
libmy.h:90:0: warning: "__libc_lock_unlock" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:377:0: note: this is the location of the previous definition
libmy.h:91:0: warning: "__libc_rwlock_unlock" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:380:0: note: this is the location of the previous definition
In file included from localeinfo.h:17:0,
from duplocale.c:45:
libmy.h:84:0: warning: "__libc_lock_define" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:73:0: note: this is the location of the previous definition
libmy.h:85:0: warning: "__rtld_lock_define_recursive" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:79:0: note: this is the location of the previous definition
libmy.h:86:0: warning: "__libc_rwlock_define" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:75:0: note: this is the location of the previous definition
libmy.h:87:0: warning: "__libc_lock_lock" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:258:0: note: this is the location of the previous definition
libmy.h:88:0: warning: "__libc_rwlock_rdlock" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:261:0: note: this is the location of the previous definition
libmy.h:89:0: warning: "__libc_rwlock_wrlock" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:263:0: note: this is the location of the previous definition
libmy.h:90:0: warning: "__libc_lock_unlock" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:377:0: note: this is the location of the previous definition
libmy.h:91:0: warning: "__libc_rwlock_unlock" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:380:0: note: this is the location of the previous definition
In file included from localeinfo.h:17:0,
from freelocale.c:44:
libmy.h:84:0: warning: "__libc_lock_define" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:73:0: note: this is the location of the previous definition
libmy.h:85:0: warning: "__rtld_lock_define_recursive" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:79:0: note: this is the location of the previous definition
libmy.h:86:0: warning: "__libc_rwlock_define" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:75:0: note: this is the location of the previous definition
libmy.h:87:0: warning: "__libc_lock_lock" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:258:0: note: this is the location of the previous definition
libmy.h:88:0: warning: "__libc_rwlock_rdlock" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:261:0: note: this is the location of the previous definition
libmy.h:89:0: warning: "__libc_rwlock_wrlock" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:263:0: note: this is the location of the previous definition
libmy.h:90:0: warning: "__libc_lock_unlock" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:377:0: note: this is the location of the previous definition
libmy.h:91:0: warning: "__libc_rwlock_unlock" redefined [enabled by default]
/usr/include/x86_64-linux-gnu/bits/libc-lock.h:380:0: note: this is the location of the previous definition
In file included from ../guid.cc:22:0:
../guid.h:29:23: fatal error: uuid/uuid.h: No such file or directory
compilation terminated.
make: *** [guid.o] Error 1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Okay I got a little further, I had to install uuid-dev by running "sudo apt-get install uuid-dev". Now after running "make" I am getting the following at the end of the output in terminal:
cc -m64 -mno-red-zone -D_FILE_OFFSET_BITS=64 -Os -fno-inline -mno-mmx -mno-sse -fPIC -DPIC -ffreestanding -fshort-wchar -fno-stack-protector -fno-stack-check -fomit-frame-pointer -fno-asynchronous-unwind-tables -fno-unwind-tables -maccumulate-outgoing-args -Wall -Wextra -fno-exceptions -Ignu-efi-3.0.1/inc -Ignu-efi-3.0.1/inc/x86_64 -c -o uuid.o uuid.c
ld -nostdlib --no-undefined -Telf-x86_64.lds \
start-x86_64.o relocate-x86_64.o initfini.o efi_main.o thread.o io.o fio.o alloc.o time.o crc32.o support.o guid.o gptpart.o mbrpart.o basicmbr.o mbr.o gpt.o bsd.o parttypes.o attributes.o diskio.o diskio-unix.o gdisk.o gpttext.o debug.o dynamic_cast.o uuid.o -Llibmy -lmy -Bshareable -Bsymbolic -Bstatic -znocombreloc -zrelro -L/usr/lib/gcc/x86_64-linux-gnu/4.6 -lstdc++ -lgcc_eh \
-Lgnu-efi-3.0.1/lib -lefi -Lgnu-efi-3.0.1/gnuefi -lgnuefi \
--entry=_start -lmy -o gdisk.so
ld: /usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++.a(ios_init.o): relocation R_X86_64_32 against `pthread_cancel' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++.a: could not read symbols: Bad value
make: *** [gdisk.so] Error 1
I searched online for this error "/usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++.a: could not read symbols: Bad value" and found this https://github.com/xerial/snappy-java/issues/85. Does this have anything to do with my issue building UEFI GPT fdisk?
I checked my gcc version by running "gcc -v" and got this:
Seems to me you're close to building a running application though.
I'm a bit surprised version 0.8.10 of gdisk still needs UEFI patching, I tought my changes had been included in this release.
Can you please use "make clean" and try "make" again ? The "make clean" should remove all files produced by the compilation steps so the next "make" rebuilds everything.
I'm a bit worried about your version 4.6 of file libstdc++.a, I think I never used this one (the current version is 4.9 and it was 4.7 or 4.8 when I started the project).
I'll setup a compilation environment using Ubuntu 12.04LTS to check this issue and I'll keep you posted.
Regards,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No still same issue when re-building after running "make clean". All the files get put into the directory /home/$USER/Downloads/gptfdisk-0.8.10, which get deleted each time, since I created a script to build UEFI GPT fdisk (see below). So I guess I don't need to worry about running "make clean"? I included it in the script (just before running "make") just in case.
"Depending on the version of GTP fdisk you use you need to patch some files or not (GPT fdisk author has incorporated my patches in version >0.8.10). If you use version 0.8.10 of GPT fdisk, there is a small patch to be applied to GPT fdisk sources, the PATCH.sh script is ready for that."
It has a greater than (>) sign, meaning the patch is only incorporated in versions greater than 0.8.10, and it also says specifically if using version 0.8.10 then to apply the patch.
I automated the process of building UEFI GPT fdisk with the following script:
#!/bin/bashcd /home/$USER/Downloads
# Remove gptfdisk-0.8.10 if already exists from prevoius build attempt:if[ -d "$(pwd)/gptfdisk-0.8.10"];thenif[ ! -L "$(pwd)/gptfdisk-0.8.10"];then
rm -r $(pwd)/gptfdisk-0.8.10
fifi# Downloaded "gptfdisk-0.8.10.tar.gz" from http://sourceforge.net/projects/gptfdisk/# Extracted the contents to "/home/$USER/Downloads/gptfdisk-0.8.10" by running "tar -zxvf gptfdisk-0.8.10.tar.gz"
tar -zxvf gptfdisk-0.8.10.tar.gz
# Downloaded "uefigptfdisk-0.2.tar.gz" from https://sourceforge.net/projects/uefigptfdisk/# Extracted the contents to "/home/$USER/Downloads/gptfdisk-0.8.10/uefi-0.2" by running "tar -zxvf uefigptfdisk-0.2.tar.gz -C gptfdisk-0.8.10"
tar -zxvf uefigptfdisk-0.2.tar.gz -C gptfdisk-0.8.10
# Downloaded "gnu-efi-3.0.1.tar.bz2" from https://sourceforge.net/projects/gnu-efi/# Extracted the contents to "/home/$USER/Downloads/gptfdisk-0.8.10/uefi-0.2/gnu-efi-3.0" by running "tar -xvjf gnu-efi-3.0.1.tar.bz2 -C gptfdisk-0.8.10/uefi-0.2"
tar -xvjf gnu-efi-3.0.1.tar.bz2 -C gptfdisk-0.8.10/uefi-0.2
cd"/home/$USER/Downloads/gptfdisk-0.8.10/uefi-0.2"
./PATCH.sh
# Put line from Makefile containing "gnu-efi-" (ex: "GNUEFI := gnu-efi-3.0") and place into variable name "old":old=$(cat /home/$USER/Downloads/gptfdisk-0.8.10/uefi-0.2/Makefile | grep "gnu-efi-")# Put new version content of GNUEFI into variable name "new":new="GNUEFI := gnu-efi-3.0.1"# Replace contents of Makefile containing contents of variable name "old" with contents of variable name "new":
sed -i "s|${old}|${new}|g" /home/$USER/Downloads/gptfdisk-0.8.10/uefi-0.2/Makefile
# Add line to undefine variables before defining them (results from build complained these variables needed to be undefined before defining them):arrayLibmyH=("__libc_lock_define""__rtld_lock_define_recursive""__libc_rwlock_define""__libc_lock_lock""__libc_rwlock_rdlock""__libc_rwlock_wrlock""__libc_lock_unlock""__libc_rwlock_unlock")for i in "${arrayLibmyH[@]}"do sed -i "/#define $i/i#undef $i" /home/$USER/Downloads/gptfdisk-0.8.10/uefi-0.2/libmy/libmy.h
done# Remove all files produced by the compilation steps:
make clean
# Build gptfdisk-0.8.10 from source files:
make
I've attached a copy of the output when running the above. I used the following command to put the output of the script into a text file:
I've been working on your issue and it's more complicated than I hoped it would.
Quick answer is I did build a working copy of gdisk.efi under Ubuntu 12.04LTS but not out of the box, I had to install a new version of gcc and g++. A better way could be installing a more recent version of Ubuntu if possible.
The main problem with building GPT fdisk for UEFI is that the x86_64 ABI used by Linux is very different from the ABI used by UEFI so basically all code is built in position independent code (called PIC, look for the -fPIC option on every call of gcc or g++) and the glue between the two ABI is in start-x86_64.S and in relocate-x86_64.c for start-up and gnu-efi modules for system calls. For a reason I do not know gcc version 4.6 (version packaged with Ubuntu 12.04LTS) has libraries that are not fully PIC.
I first compiled the same way as you did and got the same error. A symbol in library libstdc++.a, module ios_init.o, uses a relocation entry of type R_X86_64_32 incompatible with PIC. You can verify that using the following commands:
ar x /usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++.a ios_init.o
objdump -r ios_init.o | grep pthread
since this problem sources deep in the includes of C++ and this error is probably just the first one in many, I wouldn't try to recompile the whole library for PIC, so abandon this option.
I then tried to use a library called libstdc++6-4.6_pic which a presumably a PIC version of the library but this is not enough either. Modifying the Makefile to reference stdlibc++-pic instead of stdlibc++.a I got a new error complaining on the version of the symbol _ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKwm@@GLIBCXX_3.4.5, so instead of try to resolve this version conflict which is once again probably one in many, I tried a completely different approach.
I needed Internet access to the Ubuntu repositories, I had my Ubuntu apt-get aim at the developers tools repositories, installed version 4.8 of GCC and G++ and their libraries, then used them as default tools (it could be possible to change the definition of symbols GCC and CXX during the make but haven't tried that):
Hope my instructions will help you. Be aware still that improper use of this UEFI GPT fdisk tool has been known to make a computer unbootable or worse, destroying data.
Regards,
Last edit: bub'soft 2015-03-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
But when attempting to build UEFI GPT fdisk, I got the following at the end of the output in terminal:
Unable to exec gcc.real: No such file or directory
make[1]: *** [abs.o] Error 2
make[1]: Leaving directory `/home/kjesso/Downloads/gptfdisk-0.8.10/uefi-0.2/libmy'
make: *** [libmy/libmy.a] Error 2
When running "gcc --version" I get the following:
The program 'gcc' can be found in the following packages:
* gcc
* pentium-builder
I attempted to install both by running "sudo apt-get install gcc" and "sudo apt-get install pentium builder", but then was getting the following when running "gcc --version"
Unable to exec gcc.real: No such file or directory
To fix this I ran the following to create symbolic links:
However, I'm still getting "Unable to exec gcc.real: No such file or directory" towards the end of my Makefile output:
Unable to exec gcc.real: No such file or directory
make[1]: *** [abs.o] Error 2
make[1]: Leaving directory `/home/kjesso/Downloads/gptfdisk-0.8.10/uefi-0.2/libmy'
make: *** [libmy/libmy.a] Error 2
I also ran "sudo apt-get -f install" to try and fix any broken dependencies, then again re-ran your commands in your above post, but still have the same issue.
Before upgrading gcc and g++, when I ran "gcc --version", I used to get:
gcc (Ubuntu 4.8.1-2ubuntu1~12.04) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Here's what I get from the following commands:
kjesso@Linux:/usr/bin$ for i in gcc g++;do ls -al /usr/bin/$i*;done
I keep digging and might be creating more problems instead of fixing anything. In my searching I found I was missing "LIBRARY_PATH" and "LD_LIBRARY_PATH" from my environment variables list (after running "printenv"). In trying to fix this I think I accidentally cleared my LIBRARY_PATH and LD_LIBRARY_PATH variables if they weren't already cleared.
I guess I should stop now before I cause any more problems then what I'm trying to fix. Hopefully you will see this and have some idea what I'm missing.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Okay, I ended up reformatting my Linux partition and installing Ubuntu 14.04 LTS. I've been thinking about doing this anyway, but was really curious to see if I could get this running on 12.04 LTS without upgrading. After installing Ubuntu 14.04 LTS I just had to install g++ and uuid-dev bofore it would build. Thanks so much for all your help regardless, it was fun trying to figure it out. Now I have a working copy of gdisk that I can launch from the rEFInd boot menu. It was actually really good I did upgrade, since in upgrading I at the same time fixed some issues I had with my triple-boot setup (Ubuntu, Windows 7 32-bit, Mac OS X 10.6) in the process.
When you said "Be aware still that improper use of this UEFI GPT fdisk tool has been known to make a computer unbootable or worse, destroying data." Did you mean this version specifically "UEFI GPT fdisk" or just "GPT fdisk" in general? I've been using GPT fdisk (gdisk from http://www.rodsbooks.com/gdisk/) in my Mac OS X environment prior to attempting to run this particular version, so I'm already aware of the risks.
Last edit: Keith J. 2015-03-25
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm glad to hear that you finally were able to build a running version of the program.
My comment on the danger of using the program was "in general" as you guessed. In fact any partitioning program has this same potential of making a computer unbootable in case of misuse.
Thank you for your feedback. Regards,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here are the steps I followed in order to attempt building UEFI GPT fdisk on Ubuntu 12.04 LTS:
While still in the same directory "/home/$USER/Downloads/gptfdisk-0.8.10/uefi-0.2" I tried to build UEFI GPT fdisk by running "make", but instead the following was returned:
To fix this I had to change the line GNUEFI := gnu-efi-3.0 inside the Makefile to GNUEFI := gnu-efi-3.0.1 and then re-run "make" again. This time it starting building, but I'm not sure if it was successful or where the output of the build went.
This is a list of all the files I had in my "uefi-0.2" subfolder before running "make":
This is a list of all the files I have in my "uefi-0.2" subfolder after running "make":
But I don't see any gdisk.efi or *.efi file. I'm still fairly new to building applications, so maybe I'm missing something obvious or doing something wrong?
Last edit: Keith J. 2015-02-24
Here's the output after running "make":
Okay I got a little further, I had to install uuid-dev by running "sudo apt-get install uuid-dev". Now after running "make" I am getting the following at the end of the output in terminal:
I searched online for this error "/usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++.a: could not read symbols: Bad value" and found this https://github.com/xerial/snappy-java/issues/85. Does this have anything to do with my issue building UEFI GPT fdisk?
I checked my gcc version by running "gcc -v" and got this:
Last edit: Keith J. 2015-02-25
Hi,
Sorry the build is not straightforward for you.
Seems to me you're close to building a running application though.
I'm a bit surprised version 0.8.10 of gdisk still needs UEFI patching, I tought my changes had been included in this release.
Can you please use "make clean" and try "make" again ? The "make clean" should remove all files produced by the compilation steps so the next "make" rebuilds everything.
I'm a bit worried about your version 4.6 of file libstdc++.a, I think I never used this one (the current version is 4.9 and it was 4.7 or 4.8 when I started the project).
I'll setup a compilation environment using Ubuntu 12.04LTS to check this issue and I'll keep you posted.
Regards,
No still same issue when re-building after running "make clean". All the files get put into the directory /home/$USER/Downloads/gptfdisk-0.8.10, which get deleted each time, since I created a script to build UEFI GPT fdisk (see below). So I guess I don't need to worry about running "make clean"? I included it in the script (just before running "make") just in case.
I also tested skipping the patch step, but it still failed to build. The reason why I ran the patch is because it asks you to do this in the readme steps (https://sourceforge.net/projects/uefigptfdisk/files/?source=navbar):
It has a greater than (>) sign, meaning the patch is only incorporated in versions greater than 0.8.10, and it also says specifically if using version 0.8.10 then to apply the patch.
I automated the process of building UEFI GPT fdisk with the following script:
I've attached a copy of the output when running the above. I used the following command to put the output of the script into a text file:
If necessary, I can try updating libstdc++.a and try again? I'm still fairly new to Linux, so I would want to make sure I'm doing it properly before trying to make any changes to the OS. Can the file be updated by replacing the original with one of the files listed here: http://packages.ubuntu.com/search?keywords=libstdc%2B%2B? Or would I have to re-build it from sources using the information listed here https://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_install?
Last edit: Keith J. 2015-03-11
Hi,
I've been working on your issue and it's more complicated than I hoped it would.
Quick answer is I did build a working copy of gdisk.efi under Ubuntu 12.04LTS but not out of the box, I had to install a new version of gcc and g++. A better way could be installing a more recent version of Ubuntu if possible.
The main problem with building GPT fdisk for UEFI is that the x86_64 ABI used by Linux is very different from the ABI used by UEFI so basically all code is built in position independent code (called PIC, look for the -fPIC option on every call of gcc or g++) and the glue between the two ABI is in start-x86_64.S and in relocate-x86_64.c for start-up and gnu-efi modules for system calls. For a reason I do not know gcc version 4.6 (version packaged with Ubuntu 12.04LTS) has libraries that are not fully PIC.
I first compiled the same way as you did and got the same error. A symbol in library libstdc++.a, module ios_init.o, uses a relocation entry of type R_X86_64_32 incompatible with PIC. You can verify that using the following commands:
since this problem sources deep in the includes of C++ and this error is probably just the first one in many, I wouldn't try to recompile the whole library for PIC, so abandon this option.
I then tried to use a library called libstdc++6-4.6_pic which a presumably a PIC version of the library but this is not enough either. Modifying the Makefile to reference stdlibc++-pic instead of stdlibc++.a I got a new error complaining on the version of the symbol _ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKwm@@GLIBCXX_3.4.5, so instead of try to resolve this version conflict which is once again probably one in many, I tried a completely different approach.
I needed Internet access to the Ubuntu repositories, I had my Ubuntu apt-get aim at the developers tools repositories, installed version 4.8 of GCC and G++ and their libraries, then used them as default tools (it could be possible to change the definition of symbols GCC and CXX during the make but haven't tried that):
Then the build went smoothly!
Hope my instructions will help you. Be aware still that improper use of this UEFI GPT fdisk tool has been known to make a computer unbootable or worse, destroying data.
Regards,
Last edit: bub'soft 2015-03-18
I ran the above lines:
But when attempting to build UEFI GPT fdisk, I got the following at the end of the output in terminal:
When running "gcc --version" I get the following:
I attempted to install both by running "sudo apt-get install gcc" and "sudo apt-get install pentium builder", but then was getting the following when running "gcc --version"
To fix this I ran the following to create symbolic links:
However, I'm still getting "Unable to exec gcc.real: No such file or directory" towards the end of my Makefile output:
I also ran "sudo apt-get -f install" to try and fix any broken dependencies, then again re-ran your commands in your above post, but still have the same issue.
Before upgrading gcc and g++, when I ran "gcc --version", I used to get:
However, now I'm getting:
Here's what I get from the following commands:
Do you know what might be wrong with my setup or something else I might be missing?
Last edit: Keith J. 2015-03-24
I keep digging and might be creating more problems instead of fixing anything. In my searching I found I was missing "LIBRARY_PATH" and "LD_LIBRARY_PATH" from my environment variables list (after running "printenv"). In trying to fix this I think I accidentally cleared my LIBRARY_PATH and LD_LIBRARY_PATH variables if they weren't already cleared.
To try and fix LIBRARY_PATH, I ran the following:
Now when running "echo $LIBRARY_PATH" I get:
To try and fix LD_LIBRARY_PATH, I ran the following:
Now when running "echo $LD_LIBRARY_PATH" I get:
I guess I should stop now before I cause any more problems then what I'm trying to fix. Hopefully you will see this and have some idea what I'm missing.
Okay, I ended up reformatting my Linux partition and installing Ubuntu 14.04 LTS. I've been thinking about doing this anyway, but was really curious to see if I could get this running on 12.04 LTS without upgrading. After installing Ubuntu 14.04 LTS I just had to install g++ and uuid-dev bofore it would build. Thanks so much for all your help regardless, it was fun trying to figure it out. Now I have a working copy of gdisk that I can launch from the rEFInd boot menu. It was actually really good I did upgrade, since in upgrading I at the same time fixed some issues I had with my triple-boot setup (Ubuntu, Windows 7 32-bit, Mac OS X 10.6) in the process.
When you said "Be aware still that improper use of this UEFI GPT fdisk tool has been known to make a computer unbootable or worse, destroying data." Did you mean this version specifically "UEFI GPT fdisk" or just "GPT fdisk" in general? I've been using GPT fdisk (gdisk from http://www.rodsbooks.com/gdisk/) in my Mac OS X environment prior to attempting to run this particular version, so I'm already aware of the risks.
Last edit: Keith J. 2015-03-25
Hi,
I'm glad to hear that you finally were able to build a running version of the program.
My comment on the danger of using the program was "in general" as you guessed. In fact any partitioning program has this same potential of making a computer unbootable in case of misuse.
Thank you for your feedback. Regards,
Just built it successfully with a Vmware Ubuntu 14.04.6 LTS with latest gnu-efi after installing first:
Does not build with latest Ubuntu releases with the default GCC and G++ versions.
To build succesfully on newest Ubuntu use:
There is an updated variant here, which builds with gcc-9:
https://github.com/jpz4085/UEFI-GPT-fdisk
Last edit: Startergo 2022-01-06