fix(core & legacy): avoid accidental build with broken stack protector

pull/1828/head
Ondrej Mikle 3 years ago
parent cb6934a490
commit 6b849b1d4d

@ -36,6 +36,20 @@
#include "messages.h"
// #include "mpu.h"
/*
* Avoid accidental build with gcc versions having broken stack protector 9.2.1 - 10.2
*/
#if defined(__GNUC__) && !defined(__llvm__)
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
#if GCC_VERSION >= 90201 && GCC_VERSION <= 100200
#error "ARM GCC versions 9.2.1 - 10.2 have broken stack smash protector, preventing build"
#endif
#endif
const uint8_t BOOTLOADER_KEY_M = 2;
const uint8_t BOOTLOADER_KEY_N = 3;
static const uint8_t * const BOOTLOADER_KEYS[] = {

@ -53,6 +53,20 @@
// from util.s
extern void shutdown_privileged(void);
/*
* Avoid accidental build with gcc versions having broken stack protector 9.2.1 - 10.2
*/
#if defined(__GNUC__) && !defined(__llvm__)
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
#if GCC_VERSION >= 90201 && GCC_VERSION <= 100200
#error "ARM GCC versions 9.2.1 - 10.2 have broken stack smash protector, preventing build"
#endif
#endif
int main(void) {
random_delays_init();

@ -35,6 +35,20 @@
#include "usb.h"
#include "util.h"
/*
* Avoid accidental build with gcc versions having broken stack protector 9.2.1 - 10.2
*/
#if defined(__GNUC__) && !defined(__llvm__)
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
#if GCC_VERSION >= 90201 && GCC_VERSION <= 100200
#error "ARM GCC versions 9.2.1 - 10.2 have broken stack smash protector, preventing build"
#endif
#endif
void layoutFirmwareFingerprint(const uint8_t *hash) {
char str[4][17] = {0};
for (int i = 0; i < 4; i++) {

@ -38,6 +38,20 @@
#include "otp.h"
#endif
/*
* Avoid accidental build with gcc versions having broken stack protector 9.2.1 - 10.2
*/
#if defined(__GNUC__) && !defined(__llvm__)
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
#if GCC_VERSION >= 90201 && GCC_VERSION <= 100200
#error "ARM GCC versions 9.2.1 - 10.2 have broken stack smash protector, preventing build"
#endif
#endif
/* Screen timeout */
uint32_t system_millis_lock_start = 0;

Loading…
Cancel
Save