Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1826731 - Support for compiling Objective C code has been discontinued in gcc compiler
Summary: Support for compiling Objective C code has been discontinued in gcc compiler
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: gcc
Version: 8.1
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: 8.0
Assignee: Marek Polacek
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-22 12:57 UTC by tharthi
Modified: 2020-10-05 08:33 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-28 19:27:14 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description tharthi 2020-04-22 12:57:27 UTC
Description of problem:


From the document released by Redhat  “Red Hat Enterprise Linux 8
Considerations in adopting RHEL 8”

"GCC no longer builds Ada, Go, and Objective C/C++ code

Capability for building code in the Ada (GNAT), GCC Go, and Objective C/C++ languages has been removed from the GCC compiler.
To build Go code, use the Go Toolset instead"

What is the way forward for Objective C applications in RHEL8.1 ? 
Why has the support been discontinued for objective C compilation in gcc ?

Thank you for your time.
Regards.






Version-Release number of selected component (if applicable):RHEL8.1


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Jeff Law 2020-05-06 17:59:07 UTC
As part of the RHEL 8 process we evaluated all the packages we were shipping and tried to eliminate packages that had limited customer need and which were not really supportable.  Objective C was one of those packages.

Can you explain what your needs are WRT Objective C?  We may be able to recommend workarounds, alternate repositories, custom builds, etc that might satisfy your requirements.

Thanks,
Jeff

Comment 2 tharthi 2020-05-07 05:44:25 UTC
Our application is written in objective-c , and we have been using gcc so far to compile it. So during the move to RHEL8 we have been  impacted by this non support of objective in gcc as well as the absence of runtime objc.

Comment 3 Jeff Law 2020-05-26 14:17:44 UTC
My recommendation here would be to use the forward compatability that exists between RHEL 7 and RHEL 8 to run the RHEL 7 application on RHEL 8.  That should in turn give your organization time to port the application to a fully supported language.

The other short term option would be to build your own GCC from our source RPMs and enable Objective-C.  That should be a one line change (search for "build_objc" in the .spec file).

Just to reiterate, these are both stop-gap measures to get you running in the immediate term.  The longer term solution is almost certainly going to require porting the application to a supported language such as C/C++, Rust, Java or even something like python..

Comment 4 tharthi 2020-05-27 05:29:48 UTC
We have started using the clang compiler to build the objective C code, and also  building the run time libraries from the libobjc2 ( https://github.com/gnustep/libobjc2 )  . The clang compiler seems to be available as part of the redhat packages, only the objective C runtime requires to be  built and packaged.

Using RHEL7 apps on RHEL8, a  bit doubtful about the library versions the application would link to and their availability on RHEL8. Hence did not choose that path.

Let us know your views on CLANG. 

If gcc were to be  built with the build_objc in the spec, will it also build the run time libraries of objective C. Can you share the version of gcc that we may have to use in such case, along with the spec file ?

Thank you.
Regards.

Comment 5 Jakub Jelinek 2020-05-27 06:57:00 UTC
(In reply to tharthi from comment #4)
> If gcc were to be  built with the build_objc in the spec, will it also build
> the run time libraries of objective C. Can you share the version of gcc that
> we may have to use in such case, along with the spec file ?

You'd just
rpm -ivh ..../gcc-8.3.1-5.el8.src.rpm # or whatever src.rpm matches your installed gcc
sed -i -e 's/^\(%global build_objc\) 0/\1 1/' ~/rpmbuild/SPECS/gcc.spec
dnf builddep ~/rpmbuild/SPECS/gcc.spec
rpmbuild -ba -v ~/rpmbuild/SPECS/gcc.spec
and ~/rpmbuild/RPMS/*/{gcc-objc{,++},libobjc}-8*.rpm
would be the packages you want to install then for ObjC and ObjC++ support.

Comment 6 tharthi 2020-05-27 07:00:00 UTC
Thank you, on my side had also had a question on CLANG and libobjc2  , it has not been answered. Can you comment ?

Comment 7 Jeff Law 2020-05-28 19:26:56 UTC
Note that while our Clang/LLVM toolkits currently include Objective-C, that's an accident.  It's almost certain Objective-C will be removed from them at some point in the near future.

The key point to remember here is that Objective-C is not a language Red Hat supports and migrating away from it to a supported language would be strongly encouraged.


Note You need to log in before you can comment on or make changes to this bug.