rpm creation from tarball fails on fedora
Version
The version of ACE and/or TAO you are using
Host machine and operating system
Target machine and operating system (if different from host)
Compiler name and version (including patch level)
The $ACE_ROOT/ace/config.h file
If you use a link to a platform-specific file, simply state which one
The $ACE_ROOT/include/makeinclude/platform_macros.GNU file
if you use a link to a platform-specific file, simply state which one (unless this isn't used in this case, e.g., with Microsoft Visual C++)
Contents of $ACE_ROOT/bin/MakeProjectCreator/config/default.features
Used by MPC when you generate your own makefiles
AREA/CLASS/EXAMPLE AFFECTED:
What example failed? What module failed to compile?
The problem effects:
Does it affect compilation, linking, or execution. Please indicate whether ACE/TAO, your application, or both are affected.
Synopsis
Brief description of the problem
Description
Detailed description of problem. Don't just say "
Repeat by
What you did to get the error; include test program or session transcript if at all possible.
Sample fix/ workaround
If available
Creation of rpm file on Fedora fails:
rpmbuild -tb /rpmbuild/SOURCES/ACE-src-7.1.3.tar.gz --without=tao
Initalization, Compilation and Linking starts. But once a warning appears (either from make or linker etc.) the process stops immediately with an error.
Same happens with newest version ACE-src-8.0.2.tar.gz. It was tried on fresh standard installations of Fedora 41, 40 and 38.
Your issue is very minimal, at least attach the log with the output of the rpmbuild command. Feel free to open a pull request with improvements for the rpm build, or check https://github.com/DOCGroup/ACE_TAO/wiki/ACE-and-TAO-Commercial-support for dedicated support, our support on github is only best effort.
rpmbuild.log rpmbuil-tmp.log Thank you for your quick answer. Please find attached the log files.
The first error I see in the log is:
/usr/bin/ld: .obj/Unload_libACE.o: relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: failed to set dynamic section sizes: bad value
...
collect2: error: ld returned 1 exit status
make[1]: *** [GNUmakefile.Library_Unload:114: UnloadLibACE] Error 1
make[1]: Leaving directory '/home/user/rpmbuild/BUILD/ace-tao-7.1.3-build/ACE_wrappers/tests'
make: *** [GNUmakefile:5540: Library_Unload] Error 2
make: *** Waiting for unfinished jobs....
The first warnings which appear during the make process stem from linking and from make itself. If you do a normal make the process ignores the warnings and continues as usual. If you do the rpmbuild, the process stops. This is my interpretation, there could be a different reason to stop.
I would think the regular make process would stop here as well ... maybe the rpmbuild has a different set of build targets or configuration?
Here is what ChatGPT thought about this specific error message: https://chatgpt.com/share/6776ec47-70dc-8008-9b97-f28fd40455e7
I'm not sure why this issue is marked as "completed" ... was it resolved somehow?
Why is .../ACE_wrappers/tests needed for the RPM?
not sure ... haven't worked on (or thought about) this in a long time ...
I reopen the issue again because some people joined the discussion.
make.log This is the lengthy log file of the successful make process.
I tried to compare the flags of the compiler and linker between rpmbuild and normal make. The compilation flags are almost identical (with -m64 explicitly in one case or implicitly in the other). The linking flags are different. Because of the error message (complaining -fpie) I guess the linker is trying to link an executable. However we want to link a shared library (option -fpic). It think we need at least the flag -shared in this case.
I am not an expert but I guess in the case of rpmbuild the make files are build on the fly by MPC. So I don't know at all how to modify the flags for the linker. Could somebody help me?
Why is
.../ACE_wrappers/testsneeded for the RPM?
Shouldn’t be needed, so why are they compiled at all?
Is there a way to disable the make of .../ACE_wrappers/tests in the tarball for the rpmbuild process as a non-expert?
Create a new mwc file within the spec file (like other files are created) and this mwc file contains only the directories that need to be compiled, similar to TAO/TAO_ACE.mwc
Well, after some iterations I got the ACE.mwc with all the necessary libraries and without the executables, you can find it attached. However there is still one conflict (see rpmbuild.log). The ace-tao.spec requires the installation of ace-gperf which is an executable in the bin directory. I think I don't really need that. If somebody knows how to modify the spec file to skip it, please give me an advice. Otherwise I will try a quick and dirty solution myself.
ace-gperf is required for tao
Ok, I used the without_tao flag to filter out ace_gperf quick and dirty without deep analysis. I have attached the diff file in case anyone is interested in the changes. Twelve rpm files were produced.