Failed to build libhugetlbfs-2.20 from source on 4.4 / 3.13 Trusty ARM64

Bug #1707887 reported by Po-Hsu Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
Fix Released
Undecided
Unassigned
linux (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

It will fail to build libhugetlbfs verison 2.20 for SRU regression-test on 3.13 ARM64

It's ok on 4.10 / 4.4 ARM64, but not 4.4.0-88.111~14.04.1 and 3.13.0-126.175 ARM64

Looks like it's failing with:
LD64 (hugelink_rw test) obj64/linkhuge_rw
/usr/bin/ld: final link failed: File truncated

This is not a regression. As this issue has been seen before.

Complete make log:
$ make
  VERSION
version string: 2.20
  CC64 obj64/elflink.o
  AS64 obj64/sys-aarch64elf.o
  CC64 obj64/hugeutils.o
  CC64 obj64/version.o
  CC64 obj64/init.o
  CC64 obj64/morecore.o
  CC64 obj64/debug.o
  CC64 obj64/alloc.o
  CC64 obj64/shm.o
  CC64 obj64/kernel-features.o
  LD64 (shared) obj64/libhugetlbfs.so
  AR64 obj64/libhugetlbfs.a
  CC64 obj64/init_privutils.o
  LD64 (shared) obj64/libhugetlbfs_privutils.so
  CCHOST obj/init_privutils.o
  CCHOST obj/debug.o
  CCHOST obj/hugeutils.o
  CCHOST obj/kernel-features.o
  ARHOST obj/libhugetlbfs_privutils.a
  CC64 obj64/gethugepagesize.o
  CC64 obj64/testutils.o
  CC64 obj64/libtestutils.o
  LD64 (lib test) obj64/gethugepagesize
  CC64 obj64/test_root.o
  LD64 (lib test) obj64/test_root
  CC64 obj64/find_path.o
  LD64 (lib test) obj64/find_path
  CC64 obj64/unlinked_fd.o
  LD64 (lib test) obj64/unlinked_fd
  CC64 obj64/misalign.o
  LD64 (lib test) obj64/misalign
  CC64 obj64/readback.o
  LD64 (lib test) obj64/readback
  CC64 obj64/truncate.o
  LD64 (lib test) obj64/truncate
  CC64 obj64/shared.o
  LD64 (lib test) obj64/shared
  CC64 obj64/private.o
  LD64 (lib test) obj64/private
  CC64 obj64/fork-cow.o
  LD64 (lib test) obj64/fork-cow
  CC64 obj64/empty_mounts.o
  LD64 (lib test) obj64/empty_mounts
  CC64 obj64/large_mounts.o
  LD64 (lib test) obj64/large_mounts
  CC64 obj64/meminfo_nohuge.o
  LD64 (lib test) obj64/meminfo_nohuge
  CC64 obj64/ptrace-write-hugepage.o
  LD64 (lib test) obj64/ptrace-write-hugepage
  CC64 obj64/icache-hygiene.o
icache-hygiene.c: In function ‘test_once’:
icache-hygiene.c:158:11: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result]
  ftruncate(fd, 0);
           ^
icache-hygiene.c:162:12: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result]
   ftruncate(fd, 0);
            ^
icache-hygiene.c:171:11: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result]
  ftruncate(fd, hpage_size);
           ^
icache-hygiene.c:177:11: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result]
  ftruncate(fd, 0);
           ^
  LD64 (lib test) obj64/icache-hygiene
  CC64 obj64/slbpacaflush.o
  LD64 (lib test) obj64/slbpacaflush
  CC64 obj64/chunk-overcommit.o
  LD64 (lib test) obj64/chunk-overcommit
  CC64 obj64/mprotect.o
  LD64 (lib test) obj64/mprotect
  CC64 obj64/alloc-instantiate-race.o
alloc-instantiate-race.c: In function ‘thread_racer’:
alloc-instantiate-race.c:114:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
  int rc;
      ^
  LD64 (lib test) obj64/alloc-instantiate-race
  CC64 obj64/mlock.o
  LD64 (lib test) obj64/mlock
  CC64 obj64/truncate_reserve_wraparound.o
  LD64 (lib test) obj64/truncate_reserve_wraparound
  CC64 obj64/truncate_sigbus_versus_oom.o
  LD64 (lib test) obj64/truncate_sigbus_versus_oom
  CC64 obj64/map_high_truncate_2.o
  LD64 (lib test) obj64/map_high_truncate_2
  CC64 obj64/truncate_above_4GB.o
  LD64 (lib test) obj64/truncate_above_4GB
  CC64 obj64/direct.o
  LD64 (lib test) obj64/direct
  CC64 obj64/misaligned_offset.o
  LD64 (lib test) obj64/misaligned_offset
  CC64 obj64/brk_near_huge.o
  LD64 (lib test) obj64/brk_near_huge
  CC64 obj64/task-size-overrun.o
  LD64 (lib test) obj64/task-size-overrun
  CC64 obj64/stack_grow_into_huge.o
  LD64 (lib test) obj64/stack_grow_into_huge
  CC64 obj64/counters.o
  LD64 (lib test) obj64/counters
  CC64 obj64/quota.o
  LD64 (lib test) obj64/quota
  CC64 obj64/heap-overflow.o
  LD64 (lib test) obj64/heap-overflow
  CC64 obj64/get_huge_pages.o
  LD64 (lib test) obj64/get_huge_pages
  CC64 obj64/get_hugepage_region.o
  LD64 (lib test) obj64/get_hugepage_region
  CC64 obj64/shmoverride_linked.o
shmoverride_linked.c: In function ‘local_read_meminfo’:
shmoverride_linked.c:113:11: warning: variable ‘readerr’ set but not used [-Wunused-but-set-variable]
  int len, readerr;
           ^
  LD64 (lib test) obj64/shmoverride_linked
  CC64 obj64/gethugepagesizes.o
  LD64 (lib test) obj64/gethugepagesizes
  CC64 obj64/madvise_reserve.o
  LD64 (lib test) obj64/madvise_reserve
  CC64 obj64/fadvise_reserve.o
  LD64 (lib test) obj64/fadvise_reserve
  CC64 obj64/readahead_reserve.o
  LD64 (lib test) obj64/readahead_reserve
  CC64 obj64/shm-perms.o
  LD64 (lib test) obj64/shm-perms
  CC64 obj64/mremap-expand-slice-collision.o
  LD64 (lib test) obj64/mremap-expand-slice-collision
  CC64 obj64/mremap-fixed-normal-near-huge.o
  LD64 (lib test) obj64/mremap-fixed-normal-near-huge
  CC64 obj64/mremap-fixed-huge-near-normal.o
  LD64 (lib test) obj64/mremap-fixed-huge-near-normal
  CC64 obj64/corrupt-by-cow-opt.o
  LD64 (lib test) obj64/corrupt-by-cow-opt
  CC64 obj64/noresv-preserve-resv-page.o
  LD64 (lib test) obj64/noresv-preserve-resv-page
  CC64 obj64/noresv-regarded-as-resv.o
  LD64 (lib test) obj64/noresv-regarded-as-resv
  CC64 obj64/fallocate_basic.o
  LD64 (lib test) obj64/fallocate_basic
  CC64 obj64/fallocate_align.o
  LD64 (lib test) obj64/fallocate_align
  CC64 obj64/fallocate_stress.o
  LD64 (lib test) obj64/fallocate_stress
  CC64 obj64/malloc.o
  LD64 (nolib test) obj64/malloc
  CC64 obj64/malloc_manysmall.o
  LD64 (nolib test) obj64/malloc_manysmall
  CC64 obj64/dummy.o
  LD64 (nolib test) obj64/dummy
  CC64 obj64/heapshrink.o
  LD64 (nolib test) obj64/heapshrink
  CC64 obj64/shmoverride_unlinked.o
shmoverride_unlinked.c: In function ‘local_read_meminfo’:
shmoverride_unlinked.c:113:11: warning: variable ‘readerr’ set but not used [-Wunused-but-set-variable]
  int len, readerr;
           ^
  LD64 (nolib test) obj64/shmoverride_unlinked
  CC64 obj64/mmap-gettest.o
  LD64 (lib test) obj64/mmap-gettest
  CC64 obj64/mmap-cow.o
  LD64 (lib test) obj64/mmap-cow
  CC64 obj64/shm-gettest.o
  LD64 (lib test) obj64/shm-gettest
  CC64 obj64/shm-getraw.o
  LD64 (lib test) obj64/shm-getraw
  CC64 obj64/shm-fork.o
  LD64 (lib test) obj64/shm-fork
  SCRIPT64 obj64/dummy.ldscript
  CC64 obj64/zero_filesize_segment.o
  LD64 (preload test) obj64/zero_filesize_segment
/usr/bin/ld: warning: zero_filesize_segment.ld contains output sections; did you forget -T?
  CC64 obj64/linkhuge.o
  LD64 (hugelink test) obj64/linkhuge
  CC64 obj64/linkhuge_nofd.o
  LD64 (hugelink test) obj64/linkhuge_nofd
  CC64 obj64/linkshare.o
  LD64 (hugelink test) obj64/linkshare
  CC64 obj64/linkhuge_rw.o
  LD64 (hugelink_rw test) obj64/linkhuge_rw
/usr/bin/ld: final link failed: File truncated
collect2: error: ld returned 1 exit status
make[1]: *** [obj64/linkhuge_rw] Error 1
make: *** [tests/all] Error 2

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Compares to amd64 and i386 build, the amd64 one does not have linkhuge_rw.c compiled:

LD64 (hugelink test) obj64/linkhuge_nofd
CC64 obj64/linkshare.o
LD64 (hugelink test) obj64/linkshare
LD64 (xB test) obj64/xB.linkhuge
LD64 (xB test) obj64/xB.linkhuge_nofd
LD64 (xB test) obj64/xB.linkshare
LD64 (xBDT test) obj64/xBDT.linkhuge
LD64 (xBDT test) obj64/xBDT.linkhuge_nofd
LD64 (xBDT test) obj64/xBDT.linkshare
CC64 obj64/straddle_4GB.o

i386 build works fine with it.

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1707887

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: trusty
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

More debug shows that it will acquire the following status from the libhugetlbfs-2.20/Makefile

CC64 = $(CC)
ELF64 = aarch64elf
TMPLIB64 = lib64
CUSTOM_LDSCRIPTS = no

And in libhugetlbfs-2.20/test/Makefile the linkhuge_rw will be built since:

ifdef ELF64
ifeq ($(CUSTOM_LDSCRIPTS),yes)
TESTS += $(LDSCRIPT_TESTS) $(HUGELINK_TESTS) $(HUGELINK_TESTS:%=xB.%) \
        $(HUGELINK_TESTS:%=xBDT.%)
else
TESTS += $(LDSCRIPT_TESTS) $(HUGELINK_TESTS) $(HUGELINK_RW_TESTS)
endif

From here it will pass the ELF64 check, but go to the else as the CUSTOM_LDSCRIPTS is "no".
This explains why it's not being built for amd64

Po-Hsu Lin (cypressyew)
tags: added: bot-stop-nagging
Po-Hsu Lin (cypressyew)
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Sean Feole (sfeole) wrote :

Sam, does this need to be chased down?

 very old bug, with no action on it, marking bug as incomplete and will close in 5 days if no update.

Changed in ubuntu-kernel-tests:
status: New → Incomplete
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

This test can be run on Trusty / Xenial ARM64 now.
Thanks

Changed in ubuntu-kernel-tests:
status: Incomplete → Fix Released
Changed in linux (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.