Skip to content
Snippets Groups Projects
Commit 870abf15 authored by Armin Luntzer's avatar Armin Luntzer
Browse files

basic fixup to compile with bcc2 gcc/clang

parent 9cc6a090
No related branches found
No related tags found
No related merge requests found
......@@ -464,7 +464,8 @@ ARCH_AFLAGS :=
ARCH_CFLAGS :=
-include arch/$(ARCH)/Makefile
KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
# XXX unsuppported by clang
#KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
ifdef CONFIG_CC_OPTIMIZE_NONE
KBUILD_CFLAGS += -O0 $(call cc-disable-warning,maybe-uninitialized,)
......
ARCH_CFLAGS = -mcpu=v8
# gcc (7.2.0)
ARCH_CFLAGS = -mcpu=leon3 -mfix-gr712rc
# gcc (4.x)
#ARCH_CFLAGS = -mcpu=v8 -mfix-gr712rc
# clang
#ARCH_CFLAGS = -mcpu=gr712rc
......@@ -36,10 +36,11 @@ struct thread_info {
int softirq_count;
int hardirq_count;
uint32_t __unused;
/* bcc is stupid and does not respect the aligned attribute */
int unused;
/* Context switch saved kernel state. */
unsigned long ksp; /* ... ksp __attribute__ ((aligned (8))); */
unsigned long ksp __attribute__ ((aligned (8)));
unsigned long kpc;
unsigned long kpsr;
unsigned long kwim;
......
......@@ -251,7 +251,27 @@ void bootmem_init(void)
/* now add the remaining memory banks */
/**
* XXX bcc2 (sparc-gaisler-elf-gcc) 7.2.0 screws this up by swallowing
* a cmp; bne sequence after the call to page_map_add and placing
* the required ret; restore sequence along with some instructions
* for one of the BUG() related printks lower down in the remaining
* instruction. The function consequently never returns, and partially
* removing sections of this loop results in apparent random BUG()s,
* because all of the generated instructions are ordered to the end of
* the function. The reason appears to be some flawed optimisation
* heuristic, because the problem goes away, when SPARC_PHYS_BANKS
* is set to a value > 0, which means that sp_banks will have
* more than a single entry and the check of base_pfn vs the
* bank's base address results in the rest of the loop being taken.
*/
#define BCC2_IS_RETARDED
#ifdef BCC2_IS_RETARDED
for (i = 0; i <= SPARC_PHYS_BANKS; i++) {
#else
for (i = 0; sp_banks[i].num_bytes != 0; i++) {
#endif
BUG_ON(i > SPARC_PHYS_BANKS);
......
......@@ -131,14 +131,14 @@ mna_trap_handler:
fpe_trap_handler:
.global tag_overflow_trap_handler
tag_overflow_trap_handler:
.global mna_trap_handler
mna_trap_handler:
# .global mna_trap_handler /* CLANG! */
#mna_trap_handler:
.global cpdis_trap_handler
cpdis_trap_handler:
.global cpex_trap_handler
cpex_trap_handler:
.global fpe_trap_handler
fpe_trap_handler:
# .global fpe_trap_handler
#fpe_trap_handler:
.global hw_div0_trap_handler
hw_div0_trap_handler:
.global nmi_entry
......
......@@ -69,6 +69,12 @@ struct task_struct {
struct sched_attr attr;
/* bcc is SO extremely stupid, it misaligns 64-bit types and generates
* ldd's to laod them; also, it does not respect the aligned attribute
*/
int unused;
ktime runtime; /* remaining runtime in this period */
ktime wakeup; /* start of next period */
ktime deadline; /* deadline of current period */
......
......@@ -28,6 +28,8 @@
#if defined(GCC_VERSION) && (GCC_VERSION >= 40402)
#include <stdint.h>
#else
#include <stdint.h>
#if 0 /* XXX need CLANG FIX */
/* this must do... */
typedef unsigned long uintptr_t;
typedef signed long intptr_t;
......@@ -52,7 +54,7 @@ compile_time_assert(sizeof(uint16_t) == 2, TYPES_UINT16_SIZE_INVALID);
compile_time_assert(sizeof( int16_t) == 2, TYPES__INT16_SIZE_INVALID);
compile_time_assert(sizeof(uint8_t) == 1, TYPES_UINT_8_SIZE_INVALID);
compile_time_assert(sizeof( int8_t) == 1, TYPES__INT_8_SIZE_INVALID);
#endif
#endif
#ifndef __SIZEOF_LONG__
......
......@@ -265,7 +265,7 @@ static size_t eval_flags(const char *fmt, struct fmt_spec *spec)
static size_t eval_width(const char *fmt, struct fmt_spec *spec, va_list *args)
{
int w;
int w = 0;
char *end;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment