ACE_TAO icon indicating copy to clipboard operation
ACE_TAO copied to clipboard

rpm creation from tarball fails on fedora

Open StumpfMichael opened this issue 1 year ago • 16 comments

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 " doesn't work, here's a fix," explain what your program does to get to the state.

Repeat by

What you did to get the error; include test program or session transcript if at all possible.

Sample fix/ workaround

If available

StumpfMichael avatar Dec 30 '24 16:12 StumpfMichael

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.

StumpfMichael avatar Dec 30 '24 16:12 StumpfMichael

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.

jwillemsen avatar Dec 31 '24 10:12 jwillemsen

rpmbuild.log rpmbuil-tmp.log Thank you for your quick answer. Please find attached the log files.

StumpfMichael avatar Dec 31 '24 16:12 StumpfMichael

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

ksedgwic avatar Jan 02 '25 19:01 ksedgwic

I'm not sure why this issue is marked as "completed" ... was it resolved somehow?

ksedgwic avatar Jan 02 '25 19:01 ksedgwic

Why is .../ACE_wrappers/tests needed for the RPM?

mitza-oci avatar Jan 02 '25 19:01 mitza-oci

not sure ... haven't worked on (or thought about) this in a long time ...

ksedgwic avatar Jan 02 '25 20:01 ksedgwic

I reopen the issue again because some people joined the discussion.

StumpfMichael avatar Jan 02 '25 20:01 StumpfMichael

make.log This is the lengthy log file of the successful make process.

StumpfMichael avatar Jan 03 '25 01:01 StumpfMichael

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?

StumpfMichael avatar Jan 04 '25 03:01 StumpfMichael

Why is .../ACE_wrappers/tests needed for the RPM?

Shouldn’t be needed, so why are they compiled at all?

jwillemsen avatar Jan 04 '25 11:01 jwillemsen

Is there a way to disable the make of .../ACE_wrappers/tests in the tarball for the rpmbuild process as a non-expert?

StumpfMichael avatar Jan 05 '25 14:01 StumpfMichael

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

jwillemsen avatar Jan 06 '25 08:01 jwillemsen

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.

rpmbuild.log ACE.mwc.log

StumpfMichael avatar Jan 06 '25 11:01 StumpfMichael

ace-gperf is required for tao

jwillemsen avatar Jan 06 '25 12:01 jwillemsen

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.

ace-tao.spec-diff.log

StumpfMichael avatar Jan 06 '25 17:01 StumpfMichael