10000 Prep for GCC10 by tannewt · Pull Request #3194 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

Prep for GCC10 #3194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ bool run_code_py(safe_mode_t safe_mode) {
}
}

FIL* boot_output_file;

void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) {
// If not in safe mode, run boot before initing USB and capture output in a
// file.
Expand Down
4 changes: 2 additions & 2 deletions ports/atmel-samd/mphalport.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
#define mp_hal_ticks_ms() ((mp_uint_t) supervisor_ticks_ms32())

// Number of bytes in receive buffer
volatile uint8_t usb_rx_count;
volatile bool mp_cdc_enabled;
extern volatile uint8_t usb_rx_count;
extern volatile bool mp_cdc_enabled;

int receive_usb(void);

Expand Down
4 changes: 2 additions & 2 deletions py/objstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, s
mp_obj_t index, bool is_slice);
const byte *find_subbytes(const byte *haystack, size_t hlen, const byte *needle, size_t nlen, int direction);

const char nibble_to_hex_upper[16];
const char nibble_to_hex_lower[16];
extern const char nibble_to_hex_upper[16];
extern const char nibble_to_hex_lower[16];

MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_encode_obj);
MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_find_obj);
Expand Down
5 changes: 5 additions & 0 deletions py/py.mk
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,11 @@ $(HEADER_BUILD)/qstrdefs.generated.h: $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/

$(PY_BUILD)/qstr.o: $(HEADER_BUILD)/qstrdefs.generated.h

# Standard C functions like memset need to be compiled with special flags so
# the compiler does not optimise these functions in terms of themselves.
CFLAGS_BUILTIN ?= -ffreestanding -fno-builtin -fno-lto
$(BUILD)/lib/libc/string0.o: CFLAGS += $(CFLAGS_BUILTIN)

# Force nlr code to always be compiled with space-saving optimisation so
# that the function preludes are of a minimal and predictable form.
$(PY_BUILD)/nlr%.o: CFLAGS += -Os
Expand Down
2 changes: 1 addition & 1 deletion shared-bindings/_pixelbuf/PixelBuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "shared-module/_pixelbuf/PixelBuf.h"

const mp_obj_type_t pixelbuf_pixelbuf_type;
extern const mp_obj_type_t pixelbuf_pixelbuf_type;

void common_hal__pixelbuf_pixelbuf_construct(pixelbuf_pixelbuf_obj_t *self, size_t n,
pixelbuf_byteorder_details_t* byteorder, mp_float_t brightness, bool auto_write, uint8_t* header,
Expand Down
2 changes: 1 addition & 1 deletion shared-bindings/digitalio/Direction.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ typedef struct {
mp_obj_base_t base;
} digitalio_direction_obj_t;

const mp_obj_type_t digitalio_direction_type;
extern const mp_obj_type_t digitalio_direction_type;

extern const digitalio_direction_obj_t digitalio_direction_input_obj;
extern const digitalio_direction_obj_t digitalio_direction_output_obj;
Expand Down
2 changes: 1 addition & 1 deletion shared-bindings/digitalio/DriveMode.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ typedef struct {
mp_obj_base_t base;
} digitalio_drive_mode_obj_t;

const mp_obj_type_t digitalio_drive_mode_type;
extern const mp_obj_type_t digitalio_drive_mode_type;

extern const digitalio_drive_mode_obj_t digitalio_drive_mode_push_pull_obj;
extern const digitalio_drive_mode_obj_t digitalio_drive_mode_open_drain_obj;
Expand Down
2 changes: 1 addition & 1 deletion shared-bindings/digitalio/Pull.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typedef enum _digitalio_pull_t {
PULL_DOWN
} digitalio_pull_t;

const mp_obj_type_t digitalio_pull_type;
extern const mp_obj_type_t digitalio_pull_type;

typedef struct {
mp_obj_base_t base;
Expand Down
2 changes: 1 addition & 1 deletion shared-bindings/microcontroller/Processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include "common-hal/microcontroller/Processor.h"

const mp_obj_type_t mcu_processor_type;
extern const mp_obj_type_t mcu_processor_type;

uint32_t common_hal_mcu_processor_get_frequency(void);
float common_hal_mcu_processor_get_temperature(void);
Expand Down
2 changes: 1 addition & 1 deletion shared-bindings/microcontroller/RunMode.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typedef enum {
RUNMODE_BOOTLOADER
} mcu_runmode_t;

const mp_obj_type_t mcu_runmode_type;
extern const mp_obj_type_t mcu_runmode_type;

typedef struct {
mp_obj_base_t base;
Expand Down
2 changes: 1 addition & 1 deletion shared-bindings/nvm/ByteArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "common-hal/nvm/ByteArray.h"

const mp_obj_type_t nvm_bytearray_type;
extern const mp_obj_type_t nvm_bytearray_type;

uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self);

Expand Down
2 changes: 1 addition & 1 deletion shared-bindings/os/__init__.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include "py/objtuple.h"

const mp_rom_obj_tuple_t common_hal_os_uname_info_obj;
extern const mp_rom_obj_tuple_t common_hal_os_uname_info_obj;

mp_obj_t common_hal_os_uname(void);
void common_hal_os_chdir(const char* path);
Expand Down
2 changes: 1 addition & 1 deletion shared-bindings/supervisor/Runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "py/obj.h"


const mp_obj_type_t supervisor_runtime_type;
extern const mp_obj_type_t supervisor_runtime_type;

bool common_hal_get_serial_connected(void);

Expand Down
2 changes: 1 addition & 1 deletion shared-bindings/usb_hid/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "shared-module/usb_hid/Device.h"

const mp_obj_type_t usb_hid_device_type;
extern const mp_obj_type_t usb_hid_device_type;

void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t* report, uint8_t len);
uint8_t common_hal_usb_hid_device_get_usage_page(usb_hid_device_obj_t *self);
Expand Down
2 changes: 1 addition & 1 deletion supervisor/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#ifdef CIRCUITPY_BOOT_OUTPUT_FILE
#include "lib/oofatfs/ff.h"

FIL* boot_output_file;
extern FIL* boot_output_file;
#endif

void serial_early_init(void);
Expand Down
10 changes: 5 additions & 5 deletions tools/gen_usb_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,14 +539,14 @@ def strings_in_order(cls):

#include <stdint.h>

const uint8_t usb_desc_dev[{device_length}];
extern const uint8_t usb_desc_dev[{device_length}];
// Make sure the control buffer is big enough to fit the descriptor.
#define CFG_TUD_ENUM_BUFFER_SIZE {max_configuration_length}
const uint8_t usb_desc_cfg[{configuration_length}];
uint16_t usb_serial_number[{serial_number_length}];
uint16_t const * const string_desc_arr [{string_descriptor_length}];
extern const uint8_t usb_desc_cfg[{configuration_length}];
extern uint16_t usb_serial_number[{serial_number_length}];
extern uint16_t const * const string_desc_arr [{string_descriptor_length}];

const uint8_t hid_report_descriptor[{hid_report_descriptor_length}];
extern const uint8_t hid_report_descriptor[{hid_report_descriptor_length}];

#define USB_HID_NUM_DEVICES {hid_num_devices}

Expand Down
0