gcc-objc is unusable without its 'gcc' executable

  • Done
  • quality assurance status badge
Details
6 participants
  • Zhu Zihao
  • Efraim Flashner
  • ???
  • Maxime Devos
  • Ricardo Wurmus
  • Vivien Kraus
Owner
unassigned
Submitted by
???
Severity
normal
?
(address . bug-guix@gnu.org)(name . Ricardo Wurmus)(address . rekado@elephly.net)
87k1xuhd63.fsf@member.fsf.org
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.
R
R
Ricardo Wurmus wrote on 10 Dec 2017 19:49
(name . ???)(address . iyzsong@member.fsf.org)(address . 29644@debbugs.gnu.org)
87shciwh9b.fsf@elephly.net
??? <iyzsong@member.fsf.org> writes:

Toggle quote (9 lines)
> 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
Z
Z
Zhu Zihao wrote on 26 Mar 2022 06:49
Re: gcc-objc is unusable without its 'gcc' executable.
(address . 29644@debbugs.gnu.org)
86pmm91ctl.fsf@163.com
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
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQRefA5qkqvnKdl/GTlmOX+E92aT+QUCYj6p1hUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQZjl/hPdmk/kuewEAuQId9rk6i1q3O10RpeXGwrLzZIii
bIiRKG4BdpQTcnIBAOTK6v+qv7R5LSkvKilW61oBaaeDoRFJsny5/FTDcZIE
=guwc
-----END PGP SIGNATURE-----

M
M
Maxime Devos wrote on 26 Mar 2022 11:16
Re: bug#29644: gcc-objc is unusable without its 'gcc' executable.
a9b49de7822c20b0a24825c8c50439600364d6bd.camel@telenet.be
Zhu Zihao schreef op za 26-03-2022 om 13:49 [+0800]:
Toggle quote (5 lines)
> 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.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYj7n6RccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7m+YAQC8GYV/8xSPAd5Jah+4IjajbTsz
CdACx5VZazKsq8hqEgD/WIACGW3v7mUOT6BlkskI1hgNQ/HXxqyc9vD8asrDwAM=
=RNXE
-----END PGP SIGNATURE-----


Z
Z
Zhu Zihao wrote on 26 Mar 2022 11:53
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 29644@debbugs.gnu.org)
861qypx9bd.fsf@163.com
You can try with (on d05fcc21cb9509084a0424e6808b84b58dc52d62, but I
guess the commit doesn't matters.)

```
guix shell gcc@10 gcc-objc@10 clang@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

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@telenet.be> writes:

Toggle quote (15 lines)
> [[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
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQRefA5qkqvnKdl/GTlmOX+E92aT+QUCYj7zlhUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQZjl/hPdmk/kr2wD/VIU65Exj5RJ87jH0OF+g1mhXUqHE
P5DA10CNYlfQwz4A/imSFhnprbmlOh5xzXolg/DaZQv4azLqOtYMFz0ygiAD
=+8vA
-----END PGP SIGNATURE-----

M
M
Maxime Devos wrote on 26 Mar 2022 13:29
(name . Zhu Zihao)(address . all_but_last@163.com)(address . 29644@debbugs.gnu.org)
7a2e94861fbfbf9364250f63ff671efbc86ffb71.camel@telenet.be
Zhu Zihao schreef op za 26-03-2022 om 18:53 [+0800]:
Toggle quote (3 lines)
> `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"
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYj8HMxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7mmpAQDbHqUcaH1PqeEHm2CJS4LjMZzT
s4zxXMKALDco1LHZ/wD/ftgvbstSHOC5ajIIAPOtxjg/K3diYoV5/g7DBat+4wE=
=rx5C
-----END PGP SIGNATURE-----


Z
Z
Zhu Zihao wrote on 26 Mar 2022 15:14
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 29644@debbugs.gnu.org)
86fsn4kdco.fsf@163.com
Maxime Devos <maximedevos@telenet.be> writes:

Toggle quote (2 lines)
> 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
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQRefA5qkqvnKdl/GTlmOX+E92aT+QUCYj8gZxUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQZjl/hPdmk/kSlgEA5ktJddHWp7oY4ULE+tYKFodTtod1
l50Y/GyqU/ozl54BANcPdvW1FsflQZtBIemHo7O/A+dowtwCYUbDFyj73akG
=+/N0
-----END PGP SIGNATURE-----

M
M
Maxime Devos wrote on 26 Mar 2022 15:50
(name . Zhu Zihao)(address . all_but_last@163.com)(address . 29644@debbugs.gnu.org)
ffd013a58b1efe703c5ad6cff2d0d2ee9a326ad0.camel@telenet.be
Zhu Zihao schreef op za 26-03-2022 om 22:14 [+0800]:
Toggle quote (6 lines)
> Maxime Devos <maximedevos@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.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYj8oUhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7ut0AQDdsWOYhoylcOGDKw8z2Bvu4ftL
BW4wVOi8bIA6xf1MuAD/avB6B4jhvpjLPEpaJS0PRaZbcSSY2OWa/37GgfvxrAU=
=Qgqe
-----END PGP SIGNATURE-----


V
V
Vivien Kraus wrote on 2 Sep 2023 23:01
gcc-objc is unusable without its 'gcc' executable
(address . 29644@debbugs.gnu.org)
6c180fad5282e58bc5c2f3b19a113098cf86d7fb.camel@planete-kraus.eu
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:

Toggle quote (5 lines)
> 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
E
E
Efraim Flashner wrote on 6 Nov 2023 09:55
(name . Vivien Kraus)(address . vivien@planete-kraus.eu)
ZUip7OGwJEBCP-5p@3900XT
On Sat, Sep 02, 2023 at 11:01:44PM +0200, Vivien Kraus via Bug reports for GNU Guix wrote:
Toggle quote (17 lines)
> 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@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
1c1
< /gnu/store/sxnv230gv2mj5x9v3gfadw118gkl2rcf-gcc-10.5.0-lib/
---
Toggle quote (1 lines)
> /gnu/store/1p8hc8mrigismnndycwih2k2015v0z1q-gcc-objc-10.5.0-lib/
78a79,89
Toggle quote (11 lines)
> ?   ?   ?   ??? objc
> ?   ?   ?   ?   ??? message.h
> ?   ?   ?   ?   ??? NXConstStr.h
> ?   ?   ?   ?   ??? objc-decls.h
> ?   ?   ?   ?   ??? objc-exception.h
> ?   ?   ?   ?   ??? objc.h
> ?   ?   ?   ?   ??? objc-sync.h
> ?   ?   ?   ?   ??? Object.h
> ?   ?   ?   ?   ??? Protocol.h
> ?   ?   ?   ?   ??? runtime.h
> ?   ?   ?   ?   ??? thr.h
645a657,661
Toggle quote (5 lines)
> ?   ??? libobjc.a
> ?   ??? libobjc.la
> ?   ??? libobjc.so -> libobjc.so.4.0.0
> ?   ??? libobjc.so.4 -> libobjc.so.4.0.0
> ?   ??? libobjc.so.4.0.0
682c698
< ?   ??? gcc-10.5.0
---
Toggle quote (1 lines)
> ?   ??? gcc-objc-10.5.0
697c713
< 34 directories, 661 files
---
Toggle quote (1 lines)
> 35 directories, 676 files
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmVIqekACgkQQarn3Mo9
g1EprhAAwmkz4CBmA+J+669ea/1LgIdXf57X/oWHh0WzElX/AzqDub34Cu0lxOxJ
igw2mJPF3jnUNohl/RnXeco18vDMy6FDPE9T1Th/OpKAGoVd43TtbQRnLBAfo4qA
ClLtY0TNUo2PYLz4dKfrWGMYZo0dZnSJobEIX4SoDwNRjudoSX0MTBjASd1/mVMC
rCMBWvUd66mgCITMCainbJJ0UZHvZw6v8i9zqSydaN48Jc50Qe7DG4ZcbMESeU4S
0SL5x+f7FEUft0I3PMvRnynU0P+lr3ngZ2X50Zb33g1lLUXDcgXR290qbx2/QjYW
CFvYhsgDf/rKHXbpYFCHzYNGSojmFYaooyW65XtP1HdUMu9DduDA887mMLQ/7DO6
svoRtP0P1BIBlKRGyPOvsGjVMJlISgUcXHid/7MJg8Seebv7591bLMgnKlAj7CbS
zFJQp61Y3yh477jL/oBJRtLdoxCYrzFKPhWmuI/Oh3Iul7dLrLKnSomU5USSlXBc
ZvUJFDyAzpGxBYssGU+LK4/byxnTGHrfQyRH62Ya7DdVsi8UU8lSo54NbN8nRaDf
9IHBnN2c5OTQqynWU/cEAUSgjlvcNZehfV2i+YWyIEzxQB2Xbe0iIlJpjjDuRq9s
+btLFoq08HFa4kwe9Mv6M4ClvtBvYmTdGo4XOXlQeT+OQ1ucpBw=
=ksh3
-----END PGP SIGNATURE-----


E
E
Efraim Flashner wrote on 10 Dec 2023 10:34
Re: bug#66965: Acknowledgement ([CORE-UPDATES PATCH] gnu: gcc: Support objc, objc++ by default.)
ZXWGGrD1jDc1DcHr@3900XT
Patch pushed to core-updates with minimal changes.

--
Efraim Flashner <efraim@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
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmV1hhcACgkQQarn3Mo9
g1EpFg//QOout7cqJLmUNqw/iZ+zxkred28MFou9arwUa88xtGHMyIJV8vddD9g1
REDigZrrjFH5vqUL9R3FxVHry7qNh6RgBgJ0IN3EpTenIJlxh2LV4SfNDAvrraEj
9oyXkNDIc0SpnXawvYNmQBEMDBJN43FhFW7DKbWqqjGvJueK7oH+qOuMmcJRVof4
FSPkN2OpbbTEO3vYBaxyfqGzMeScNc/fU7Pi/p+mspOAOssPTLxggCLaQrKoE0av
Ey4BPMehqDglIPpHVtwgxFQNpR4YE8pN9clL2DpC2cTrQ2VTPX21jCcUgqnmv/5P
PBXsbqZJ5/S2rkp2JxCYcKNLeclPielDCDNx4qT0dQYReMlvYGDv9ZuF2aTm8awt
LRa9mOcfSELSsFa3ALiAlqHasUW+LkWP86n0FY1ftvLo4oPWRLVFARTWsP4WkljA
/7dVbk/sei3fElYrGdmmNO0pyRzHlhVas4LafmfsmCjmBt6Q75y1y80GNXksCaKM
8F4rOM9yypq5MJHWbGaZXNoA1EmwJO+fNKc8NiEzXxMg0StnxvPjAAH0BGm0oOB+
OG0YiGV78bFGx7Td/+WsyxIqFLUOC1ClYiHyeDRdHi/+76zSlFZbTuvfxWfqGdwJ
KPc485VooQT8bpM28s5OVqd4DNbJLZBi+0nZcfFwC6XOyH3s+XM=
=QOLQ
-----END PGP SIGNATURE-----


Closed
?