Files
RedBear-OS/local/recipes/dev/gcc16/source/gcc/rtl-error.cc
T
vasilito 48a924c561 recipes: regenerate Cargo.lock for the 0.3.2 fork versions
The libredox 0.1.19 / redox_syscall 0.9.1 bump left 45 recipe lockfiles
pinning libredox 0.1.18+rb0.3.1 and redox_syscall 0.9.0+rb0.3.1. The
cookbook builds with --locked, so every affected recipe died with

  error: cannot update the lock file .../Cargo.lock because --locked was
  passed to prevent this

which is what took out redox-driver-sys -- and with it every Red Bear
driver -- during the redbear-full build. Regenerating the fork lockfiles
was not enough; the recipes that consume the forks as path deps carry
their own. This is step 6 of local/docs/FORK-BUMP-PATCHING-POLICY.md
applied to the recipe layer.

Also drop the hardcoded GCC version in recipes/libs/libstdcxx-v3: the
literal include/c++/13.2.0 stopped resolving the moment the cross
toolchain moved to 16.1.0, leaving -I pointing at a directory that does
not exist. Now resolves the newest installed C++ header directory and
fails loudly if there is none. Same failure class as the hardcoded
13.2.0 in mk/prefix.mk.

Note: a few recipe-level Cargo.lock files (redox-driver-pci, cpufreqd,
redbear-acmd/-ecmd/-ftdi) sit beside a recipe.toml whose [source] is
path = "source", so they are not build inputs; redox-driver-pci's even
references a redox-driver-core/Cargo.toml that does not exist. They are
left alone rather than given meaning they do not have.

redox-driver-sys now cooks clean.
2026-08-03 14:15:38 +03:00

121 lines
3.4 KiB
C++

/* RTL specific diagnostic subroutines for GCC
Copyright (C) 2001-2026 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "rtl-error.h"
#include "diagnostic.h"
#include "intl.h"
static location_t location_for_asm (const rtx_insn *);
static void diagnostic_for_asm (const rtx_insn *, const char *, va_list *,
enum diagnostics::kind) ATTRIBUTE_GCC_DIAG(2,0);
/* Figure the location of the given INSN. */
static location_t
location_for_asm (const rtx_insn *insn)
{
rtx body = PATTERN (insn);
rtx asmop;
location_t loc;
/* Find the (or one of the) ASM_OPERANDS in the insn. */
if (GET_CODE (body) == SET && GET_CODE (SET_SRC (body)) == ASM_OPERANDS)
asmop = SET_SRC (body);
else if (GET_CODE (body) == ASM_OPERANDS)
asmop = body;
else if (GET_CODE (body) == PARALLEL
&& GET_CODE (XVECEXP (body, 0, 0)) == SET)
asmop = SET_SRC (XVECEXP (body, 0, 0));
else if (GET_CODE (body) == PARALLEL
&& GET_CODE (XVECEXP (body, 0, 0)) == ASM_OPERANDS)
asmop = XVECEXP (body, 0, 0);
else
asmop = NULL;
if (asmop)
loc = ASM_OPERANDS_SOURCE_LOCATION (asmop);
else
loc = input_location;
return loc;
}
/* Report a diagnostic MESSAGE (an error or a WARNING) at the line number
of the insn INSN. This is used only when INSN is an `asm' with operands,
and each ASM_OPERANDS records its own source file and line. */
static void
diagnostic_for_asm (const rtx_insn *insn, const char *msg, va_list *args_ptr,
enum diagnostics::kind kind)
{
diagnostics::diagnostic_info diagnostic;
rich_location richloc (line_table, location_for_asm (insn));
diagnostic_set_info (&diagnostic, msg, args_ptr,
&richloc, kind);
diagnostic_report_diagnostic (global_dc, &diagnostic);
}
void
error_for_asm (const rtx_insn *insn, const char *gmsgid, ...)
{
va_list ap;
va_start (ap, gmsgid);
diagnostic_for_asm (insn, gmsgid, &ap, diagnostics::kind::error);
va_end (ap);
}
void
warning_for_asm (const rtx_insn *insn, const char *gmsgid, ...)
{
va_list ap;
va_start (ap, gmsgid);
diagnostic_for_asm (insn, gmsgid, &ap, diagnostics::kind::warning);
va_end (ap);
}
void
_fatal_insn (const char *msgid, const_rtx insn, const char *file, int line,
const char *function)
{
error ("%s", _(msgid));
/* The above incremented error_count, but isn't an error that we want to
count, so reset it here. */
errorcount--;
debug_rtx (insn);
fancy_abort (file, line, function);
}
void
_fatal_insn_not_found (const_rtx insn, const char *file, int line,
const char *function)
{
if (INSN_CODE (insn) < 0)
_fatal_insn ("unrecognizable insn:", insn, file, line, function);
else
_fatal_insn ("insn does not satisfy its constraints:",
insn, file, line, function);
}