GNU bug report logs - #29644
gcc-objc is unusable without its 'gcc' executable

Previous Next

Package: guix;

Reported by: iyzsong <at> member.fsf.org (宋文武)

Date: Sun, 10 Dec 2017 14:27:03 UTC

Severity: normal

Done: Efraim Flashner <efraim <at> flashner.co.il>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 29644 in the body.
You can then email your comments to 29644 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#29644; Package guix. (Sun, 10 Dec 2017 14:27:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to iyzsong <at> member.fsf.org (宋文武):
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 10 Dec 2017 14:27:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: iyzsong <at> member.fsf.org (宋文武)
To: bug-guix <at> gnu.org
Cc: Ricardo Wurmus <rekado <at> elephly.net>
Subject: gcc-objc is unusable without its 'gcc' executable
Date: Sun, 10 Dec 2017 22:26:28 +0800
Hello, unlike fortran program files which can be compiled using the
command 'gfortran' (in addition to 'gcc'), there is no other command for
Objective-C program files, and run 'gcc -c x.m' using the 'gcc' package
will just complain "Objective-C compiler not installed on this system"
due to it lacking objc support.

I have to revert commit 82f145ef7a to get a objc enabled 'gcc' in the
'gcc-objc' package.

IIUC, the purpose of that commit is to avoid file collisions between
'gfortran' and the 'gcc' package used in the 'gnu-build-system', which
will broke the compiler in some way.  So I think we really want to only
have one gcc package in an environment...

How about enable all languages (except 'brig' which I never heard of)
for the gcc-final and the 'gcc' (in gcc.scm) packages?  In this way, I
think 'gnu-build-system' and 'gcc-toolchain' will able to compile
Fortran, Objective-C, Go, etc. out of the box.




Information forwarded to bug-guix <at> gnu.org:
bug#29644; Package guix. (Sun, 10 Dec 2017 18:50:02 GMT) Full text and rfc822 format available.

Message #8 received at 29644 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: 宋文武 <iyzsong <at> member.fsf.org>
Cc: 29644 <at> debbugs.gnu.org
Subject: Re: gcc-objc is unusable without its 'gcc' executable
Date: Sun, 10 Dec 2017 19:49:04 +0100
宋文武 <iyzsong <at> member.fsf.org> writes:

> Hello, unlike fortran program files which can be compiled using the
> command 'gfortran' (in addition to 'gcc'), there is no other command for
> Objective-C program files, and run 'gcc -c x.m' using the 'gcc' package
> will just complain "Objective-C compiler not installed on this system"
> due to it lacking objc support.
>
> I have to revert commit 82f145ef7a to get a objc enabled 'gcc' in the
> 'gcc-objc' package.

In May 2016 I first noticed this problem with GCC and investigated
solutions.

The fix here is to patch “lang-spec.h”, so that it does not limit the
gcc executable to the configured set of languages.  This way we will be
able to use the same gcc executable with different languages.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net






Information forwarded to bug-guix <at> gnu.org:
bug#29644; Package guix. (Sat, 26 Mar 2022 05:52:02 GMT) Full text and rfc822 format available.

Message #11 received at 29644 <at> debbugs.gnu.org (full text, mbox):

From: Zhu Zihao <all_but_last <at> 163.com>
To: 29644 <at> debbugs.gnu.org
Subject: Re: gcc-objc is unusable without its 'gcc' executable.
Date: Sat, 26 Mar 2022 13:49:45 +0800
[Message part 1 (text/plain, inline)]
I'm planning to package some GNUStep packages to Guix, but the gcc-objc
is broken.

Any one interested in fixing GCC? or I' ll plan to make gnustep-make use
clang instead of GCC.
-- 
Retrieve my PGP public key:

  gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#29644; Package guix. (Sat, 26 Mar 2022 10:17:01 GMT) Full text and rfc822 format available.

Message #14 received at 29644 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Zhu Zihao <all_but_last <at> 163.com>, 29644 <at> debbugs.gnu.org
Subject: Re: bug#29644: gcc-objc is unusable without its 'gcc' executable.
Date: Sat, 26 Mar 2022 11:16:09 +0100
[Message part 1 (text/plain, inline)]
Zhu Zihao schreef op za 26-03-2022 om 13:49 [+0800]:
> I'm planning to package some GNUStep packages to Guix, but the gcc-
> objc is broken.
> 
> Any one interested in fixing GCC? [...]

How is it broken?  Is there some error message or something?

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#29644; Package guix. (Sat, 26 Mar 2022 11:07:02 GMT) Full text and rfc822 format available.

Message #17 received at 29644 <at> debbugs.gnu.org (full text, mbox):

From: Zhu Zihao <all_but_last <at> 163.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 29644 <at> debbugs.gnu.org
Subject: Re: bug#29644: gcc-objc is unusable without its 'gcc' executable.
Date: Sat, 26 Mar 2022 18:53:07 +0800
[Message part 1 (text/plain, inline)]
You can try with (on d05fcc21cb9509084a0424e6808b84b58dc52d62, but I
guess the commit doesn't matters.)

```
guix shell gcc <at> 10 gcc-objc <at> 10 clang <at> 13

cat > hello.m << "EOF"
#include <stdio.h>

int main(int argc, const char * argv[]) {
  printf ("Hello, world!\n");
    return 0;
}
EOF
```

`LANG=C gcc hello.m -o hello` complains that Objective-C compiler is not
installed.

`LANG=C clang hello.m -o hello` can compile to hello binary.

Even I try set environment variable GCC_EXEC_PREFIX (described in
https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html)

GCC_EXEC_PREFIX=$GUIX_ENVIRONMENT/libexec/gcc/x86_64-unknown-linux-gnu/10.3.0 gcc hello.m -o hello
 
or pass option
`-B$GUIX_ENVIRONMENT/libexec/gcc/x86_64-unknown-linux-gnu/10.3.0`. It
still says no Objective-C compiler.


Maxime Devos <maximedevos <at> telenet.be> writes:

> [[PGP Signed Part:Undecided]]
> Zhu Zihao schreef op za 26-03-2022 om 13:49 [+0800]:
>> I'm planning to package some GNUStep packages to Guix, but the gcc-
>> objc is broken.
>> 
>> Any one interested in fixing GCC? [...]
>
> How is it broken?  Is there some error message or something?
>
> Greetings,
> Maxime.
>
> [[End of PGP Signed Part]]


-- 
Retrieve my PGP public key:

  gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#29644; Package guix. (Sat, 26 Mar 2022 12:30:02 GMT) Full text and rfc822 format available.

Message #20 received at 29644 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Zhu Zihao <all_but_last <at> 163.com>
Cc: 29644 <at> debbugs.gnu.org
Subject: Re: bug#29644: gcc-objc is unusable without its 'gcc' executable.
Date: Sat, 26 Mar 2022 13:29:39 +0100
[Message part 1 (text/plain, inline)]
Zhu Zihao schreef op za 26-03-2022 om 18:53 [+0800]:
> `LANG=C gcc hello.m -o hello` complains that Objective-C compiler is
> not installed.

I noticed the output of "guix build gcc-objc" does not contain any
binaries in 'bin' and neither does there appear to be some objc shared
library.  I guess this is caused by the following line:

           (add-after 'install 'remove-broken-or-conflicting-files
             (lambda* (#:key outputs #:allow-other-keys)
               (for-each
                delete-file
                (find-files (string-append (assoc-ref outputs "out")
"/bin")
                            ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|lto)(-
.*)?$"))))))))))


I'm wondering if any of the following commits fix or break things:

  * 5318bade32e2a3a801e838286439074aeaf1e3c7
    (this one modified the regex)
  * a159586f8ae4db8a0fcf608b411f962817c3db60
    (the commit before)
  * 82f145ef7aef8f4d28a144ee8efcadf3fdd4b877 
    (this one introduced the phase)
  * ce6027bf43210d0b68bb26dbf110ca6c47aa8478
    (the commit before)

Make sure to run this in an environment "guix environment --pure --ad-hoc gcc-objc"
(*) without the "gcc" package, to avoid the gcc package overriding the
hypothetical gcc from the "gcc-objc" package.

Or maybe some plugin architecture is used, I don't know..

Greetings,
Maxime.

(*) some of these commits are from before the introduction of "guix shell"
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#29644; Package guix. (Sat, 26 Mar 2022 14:19:01 GMT) Full text and rfc822 format available.

Message #23 received at 29644 <at> debbugs.gnu.org (full text, mbox):

From: Zhu Zihao <all_but_last <at> 163.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 29644 <at> debbugs.gnu.org
Subject: Re: bug#29644: gcc-objc is unusable without its 'gcc' executable.
Date: Sat, 26 Mar 2022 22:14:41 +0800
[Message part 1 (text/plain, inline)]
Maxime Devos <maximedevos <at> telenet.be> writes:

> Or maybe some plugin architecture is used, I don't know..

I think the problem is pointed out by Ricardo Wurmus in this reply https://issues.guix.gnu.org/29644#1
-- 
Retrieve my PGP public key:

  gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#29644; Package guix. (Sat, 26 Mar 2022 14:52:01 GMT) Full text and rfc822 format available.

Message #26 received at 29644 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Zhu Zihao <all_but_last <at> 163.com>
Cc: 29644 <at> debbugs.gnu.org
Subject: Re: bug#29644: gcc-objc is unusable without its 'gcc' executable.
Date: Sat, 26 Mar 2022 15:50:58 +0100
[Message part 1 (text/plain, inline)]
Zhu Zihao schreef op za 26-03-2022 om 22:14 [+0800]:
> Maxime Devos <maximedevos <at> telenet.be> writes:
> 
> > Or maybe some plugin architecture is used, I don't know..
> 
> I think the problem is pointed out by Ricardo Wurmus in this reply https://issues.guix.gnu.org/29644#1

Ok, I thought this was a new bug report, but apparently it is a reply
to an old report.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#29644; Package guix. (Sat, 02 Sep 2023 21:03:01 GMT) Full text and rfc822 format available.

Message #29 received at 29644 <at> debbugs.gnu.org (full text, mbox):

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: 29644 <at> debbugs.gnu.org
Subject: gcc-objc is unusable without its 'gcc' executable
Date: Sat, 02 Sep 2023 23:01:44 +0200
Hello!

I would like to learn and play with gnustep with objective-C, but it
seems like GCC does not come with objective-C in Guix.

I don’t know much about GCC or how Guix packages it. There is an early
comment by Ricardo Wurmus:

> The fix here is to patch “lang-spec.h”, so that it does not limit the
> gcc executable to the configured set of languages.  This way we will
> be
> able to use the same gcc executable with different languages.

The source of gcc-objc has a file named gcc-12.3.0/gcc/objc/lang-
specs.h that claims to be included as a static array literal, but I
don’t know what the rest of this citation means.

Vivien




Information forwarded to bug-guix <at> gnu.org:
bug#29644; Package guix. (Mon, 06 Nov 2023 08:56:01 GMT) Full text and rfc822 format available.

Message #32 received at 29644 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Vivien Kraus <vivien <at> planete-kraus.eu>
Cc: 29644 <at> debbugs.gnu.org, Zhu Zihao <all_but_last <at> 163.com>
Subject: Re: bug#29644: gcc-objc is unusable without its 'gcc' executable
Date: Mon, 6 Nov 2023 10:55:08 +0200
[Message part 1 (text/plain, inline)]
On Sat, Sep 02, 2023 at 11:01:44PM +0200, Vivien Kraus via Bug reports for GNU Guix wrote:
> Hello!
> 
> I would like to learn and play with gnustep with objective-C, but it
> seems like GCC does not come with objective-C in Guix.
> 
> I don’t know much about GCC or how Guix packages it. There is an early
> comment by Ricardo Wurmus:
> 
> > The fix here is to patch “lang-spec.h”, so that it does not limit the
> > gcc executable to the configured set of languages.  This way we will
> > be
> > able to use the same gcc executable with different languages.
> 
> The source of gcc-objc has a file named gcc-12.3.0/gcc/objc/lang-
> specs.h that claims to be included as a static array literal, but I
> don’t know what the rest of this citation means.

I've appended a diff of the lib output of gcc and gcc-objc. According to
du adding objc support to regular gcc would increase the lib output by
368K. I think our best option is to move forward with adding objc/objc++
as languages which gcc simply provides without needing a separate
package.


-- 
Efraim Flashner   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[gcc-objc-diff (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]

Reply sent to Efraim Flashner <efraim <at> flashner.co.il>:
You have taken responsibility. (Sun, 10 Dec 2023 09:35:02 GMT) Full text and rfc822 format available.

Notification sent to iyzsong <at> member.fsf.org (宋文武):
bug acknowledged by developer. (Sun, 10 Dec 2023 09:35:02 GMT) Full text and rfc822 format available.

Message #37 received at 29644-done <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: 66965-done <at> debbugs.gnu.org, 29644-done <at> debbugs.gnu.org
Subject: Re: bug#66965: Acknowledgement ([CORE-UPDATES PATCH] gnu: gcc:
 Support objc, objc++ by default.)
Date: Sun, 10 Dec 2023 11:34:18 +0200
[Message part 1 (text/plain, inline)]
Patch pushed to core-updates with minimal changes.

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 07 Jan 2024 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 104 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.