gcc-objc is unusable without its 'gcc' executable

  • Open
  • quality assurance status badge
Details
4 participants
  • Zhu Zihao
  • 宋文武
  • Maxime Devos
  • Ricardo Wurmus
Owner
unassigned
Submitted by
宋文武
Severity
normal
宋文武 wrote on 10 Dec 2017 15:26
(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-----


?