ya-mouse / fatresize

Resize FAT partitions using libparted
GNU General Public License v3.0
14 stars 21 forks source link

Error to build 1.0.4 #9

Closed ghost closed 6 years ago

ghost commented 6 years ago

I'm an ArchLinux user, when I try to compile version 1.0.4 the compilation process is interrupted with the following error:

make[1]: Entering directory '/tmp/makepkg/fatresize/src/fatresize-1.0.4'
gcc  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -D_FILE_OFFSET_BITS=no  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -o fatresize fatresize.o -lparted-fs-resize -lparted -ldl
fatresize.o: In function `try_snap':
fatresize.c:(.text.unlikely+0xad): undefined reference to `ped_assert'
fatresize.o: In function `main':
fatresize.c:(.text.startup+0xc83): undefined reference to `ped_assert'
fatresize.c:(.text.startup+0xd42): undefined reference to `ped_assert'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:416: fatresize] Error 1
make[1]: Leaving directory '/tmp/makepkg/fatresize/src/fatresize-1.0.4'
make: *** [Makefile:319: all] Error 2
==> ERROR: There was an error to build ().
     Canceling ...

Any idea or suggestion? Thanks

sriemer commented 6 years ago

Can you disassemble your libparted, please (objdump -D) and look for providing of ped_assert()? My guess is that it is compiled without DEBUG defined and this way it doesn't provide the required function.

sriemer commented 6 years ago

At SUSE we compile the PED_ASSERTs. Parted is not a tool where performance matters. It rather matters not to corrupt data. Because of the tight dependencies we compile fatresize within the parted package.

ghost commented 6 years ago

Effectively, in ArchLinux libparted (part of parted) it is compiled without the DEBUG option.

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  ./configure --prefix=/usr \
              --sbindir=/usr/bin \
              --disable-debug \
              --disable-rpath
  make
}

One solution would be to create a PKBUILD in the AUR repository to install libparted with this option enabled. This I have not tried yet.

But the funny thing that with version 1.0.3 of fatresize we managed to compile it without problems, and gparted did not have the option DEBUG active in its compilation.

ghost commented 6 years ago

I have solved it by creating a new version of libparted: https://aur.archlinux.org/packages/libparted/

Now fatresize 1.0.4 compiles without problems. https://aur.archlinux.org/packages/fatresize/

Thanks for the contribution.