Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpm creation from tarball fails on fedora #2310

Open
StumpfMichael opened this issue Dec 30, 2024 · 16 comments
Open

rpm creation from tarball fails on fedora #2310

StumpfMichael opened this issue Dec 30, 2024 · 16 comments

Comments

@StumpfMichael
Copy link

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
Copy link
Author

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.

@jwillemsen
Copy link
Member

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.

@StumpfMichael
Copy link
Author

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

@ksedgwic
Copy link

ksedgwic commented Jan 2, 2025

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
Copy link

ksedgwic commented Jan 2, 2025

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

@mitza-oci
Copy link
Member

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

@ksedgwic
Copy link

ksedgwic commented Jan 2, 2025

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

@StumpfMichael StumpfMichael reopened this Jan 2, 2025
@StumpfMichael
Copy link
Author

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

@StumpfMichael
Copy link
Author

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

@StumpfMichael
Copy link
Author

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?

@jwillemsen
Copy link
Member

jwillemsen commented Jan 4, 2025

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

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

@StumpfMichael
Copy link
Author

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

@jwillemsen
Copy link
Member

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

@StumpfMichael
Copy link
Author

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

@jwillemsen
Copy link
Member

ace-gperf is required for tao

@StumpfMichael
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants