Bug 274627 - lang/gcc11: D compiler spits character 0xa5 is not a valid token Outside Unicode code space
Summary: lang/gcc11: D compiler spits character 0xa5 is not a valid token Outside Unic...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Lorenzo Salvadore
URL: http://cirrus-ci.com/task/53292309264...
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-21 12:56 UTC by Gleb Popov
Modified: 2023-11-14 12:42 UTC (History)
1 user (show)

See Also:
salvadore: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gleb Popov freebsd_committer freebsd_triage 2023-10-21 12:56:08 UTC
Running

echo a | /usr/local/libexec/gcc11/gcc/x86_64-portbld-freebsd15.0/11.3.0/d21 - -quiet -dumpdir a- -dumpbase - -mtune=generic -march=x86-64 -version -fsyntax-only -o /dev/null -v 1>/dev/null

produces a ton of 

<stdin>:2: error: Outside Unicode code space
<stdin>:2: error: character 0xa5 is not a valid token

errors. The lang/ldc fails due that because it runs

echo "pragma(msg, int(__VERSION__));" | gdmd - -o-

and takes "<stdin>" part as output.

The problem can be seed on CURRENT and probably 14.0, but not on 13.2.
Comment 1 Lorenzo Salvadore freebsd_committer freebsd_triage 2023-10-25 10:21:44 UTC
I confirm the bug is present in FreeBSD 14:
http://cirrus-ci.com/task/5329230926446592

Unfortunately, I am dealing with a lot of GCC related issues and I do not have the time for this one right now, but I will try to find it as soon as possible. I add to the CC list Daniel who has enabled the D compiler in lang/gcc11{-devel} and then might be helpful.

Actually, even before trying to fix that bug, it would probably be better to try to enable the D compiler in higher versions of GCC, which is not an easy task due to boostrap issues. I have postponed this problem for a while, but I guess it is time to solve it.
Comment 2 Gleb Popov freebsd_committer freebsd_triage 2023-10-25 10:58:45 UTC
As a side note: I submitted an update for lang/ldc and switched to using binaries provided by the upstream as a bootstrap.
Comment 3 Lorenzo Salvadore freebsd_committer freebsd_triage 2023-10-25 11:12:49 UTC
(In reply to Gleb Popov from comment #2)

Oh, this is great. Then we can probably use ldc to bootstrap gdc and test if the issue affects later versions of GCC as well.
Comment 4 Gleb Popov freebsd_committer freebsd_triage 2023-11-14 12:42:50 UTC
I have landed lang/ldc update, which now doesn't require lang/gcc11 but uses a bootstrap provided by the upstream.