Ticket 11139

Summary: Build fails with slibtool.
Product: Slurm Reporter: orbea-ml
Component: Build System and PackagingAssignee: Jacob Jenson <jacob>
Status: RESOLVED INVALID QA Contact:
Severity: 6 - No support contract    
Priority: ---    
Version: 21.08.x   
Hardware: Linux   
OS: Linux   
Site: -Other- Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---
Attachments: Full build log.
Build log with undefined referenfces.
Log using GNU libtool.

Description orbea-ml 2021-03-18 16:05:17 MDT
Created attachment 18543 [details]
Full build log.

When trying to build slurm with slibtool (https://dev.midipix.org/cross/slibtool) it fails.

rdlibtool: link: ar crs .libs/libscrontab_ref.a .libs/libscrontab_ref.o
ar: .libs/libscrontab_ref.o: No such file or directory
rdlibtool: exec error upon slbt_exec_link_create_archive(), line 1219: (see child process error messages).
rdlibtool: < returned to > slbt_exec_link(), line 1805.
make[3]: *** [Makefile:600: libscrontab_ref.la] Error 2

This is because in src/scrontab/Makefile.am and some other files the libscrontab_ref.lo rule is manually set. However only GNU libtool can handle these manually created files and it is not portable.

I tried to remove it, but it then obviously fails with undefined references.

rdlibtool: link: clang opt.o parse.o scrontab.o .libs/libscrontab_ref.a -g -O2 -fno-omit-frame-pointer -pthread -ggdb3 -Wall -g -O1 -fno-strict-aliasing -Wl,-rpath=/usr/local/lib/slurm -L../../src/api/.libs -lslurmfull -ldl -L.libs -lm -lresolv -lm -o .libs/scrontab -Wl,--export-dynamic
/usr/bin/ld: scrontab.o: in function `_usage':
/tmp/slurm/src/scrontab/scrontab.c:78: undefined reference to `_binary_usage_txt_start'
/usr/bin/ld: /tmp/slurm/src/scrontab/scrontab.c:78: undefined reference to `_binary_usage_txt_end'
/usr/bin/ld: /tmp/slurm/src/scrontab/scrontab.c:78: undefined reference to `_binary_usage_txt_start'
/usr/bin/ld: scrontab.o: in function `_edit_crontab':
/tmp/slurm/src/scrontab/scrontab.c:200: undefined reference to `_binary_default_crontab_txt_start'
/usr/bin/ld: /tmp/slurm/src/scrontab/scrontab.c:200: undefined reference to `_binary_default_crontab_txt_end'
/usr/bin/ld: /tmp/slurm/src/scrontab/scrontab.c:200: undefined reference to `_binary_default_crontab_txt_start'
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
rdlibtool: exec error upon slbt_exec_link_create_executable(), line 1614: (see child process error messages).
rdlibtool: < returned to > slbt_exec_link(), line 1909.
make[3]: *** [Makefile:604: scrontab] Error 2

I am hoping someone here can help solve this issue as I am stuck so far. :)

It can be reproduced by installing slibtool in your $PATH and then exporting MAKEFLAGS='LIBTOOL=rdlibtool'.

Please see the attached build logs.

Also see these two other issues:

https://bugs.schedmd.com/show_bug.cgi?id=11132
https://bugs.schedmd.com/show_bug.cgi?id=11137
Comment 1 orbea-ml 2021-03-18 16:05:47 MDT
Created attachment 18544 [details]
Build log with undefined referenfces.
Comment 2 orbea-ml 2021-03-18 16:06:17 MDT
Created attachment 18545 [details]
Log using GNU libtool.