Skip to content
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

Travis: Support newer gcc versions #96

Merged
merged 11 commits into from
Sep 27, 2017
75 changes: 67 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,80 @@
sudo: required
dist: trusty

matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.9
- gcc-4.9-multilib
env:
- MATRIX_EVAL="CC=gcc-4.9 && ARCH=x86"

- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-5
- gcc-5-multilib
env:
- MATRIX_EVAL="CC=gcc-5 && ARCH=x86"

- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- gcc-6-multilib
env:
- MATRIX_EVAL="CC=gcc-6 && ARCH=x86"

- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- gcc-7-multilib
env:
- MATRIX_EVAL="CC=gcc-7 && ARCH=x86"

- os: linux
addons:
apt:
packages:
- gcc-arm-none-eabi
env:
- MATRIX_EVAL="ARCH=raspberrypi"

addons:
apt:
packages:

before_install:
- eval "${MATRIX_EVAL}"
- export CC
- export ARCH

before_script:
- sudo apt-get update
- sudo apt-get install
dosfstools
gcc-arm-none-eabi
gcc-multilib
genisoimage
grub
mtools
nasm
- ./install_cmocka.sh

# Tests are disabled for now since cmocka don't work on Trusty Tahr.
script:
- bundle exec rubocop
- ARCH=raspberrypi rake
default
clean
# Tests are disabled for now since cmocka don't work on Trusty Tahr.
- ARCH=x86 CC=gcc rake
default
- rake default
5 changes: 4 additions & 1 deletion libraries/string/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,11 @@ return_type string_print_va(char *output, const char *format_string,
case 'X':
{
flags |= UPPER_HEX;
}

}
// Falls through by design. (Can't use __attribute__ ((fallthrough)), since it breaks on gcc < 7.)
//
// fallthrough
case 'x':
{
char string[9];
Expand Down
11 changes: 8 additions & 3 deletions rakelib/common_rules.rake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ end
rule '.o' => ['.S'] do |t|
begin
print((t.source + ' ').cyan)
command = "#{CC} -o #{t.name} #{CFLAGS} #{INCLUDES.join(' ')} -c #{t.source}"
command = "#{CC} -o #{t.name} #{cflags} #{INCLUDES.join(' ')} -c #{t.source}"
sh command
rescue
puts "Error compiling #{t.source}. Full command line was: #{command}"
Expand All @@ -44,6 +44,11 @@ rule '.o' => ['.asm'] do |t|
end

def cflags
flags = CFLAGS.join(' ') if CFLAGS.respond_to?(:join)
flags || CFLAGS
flags = if CFLAGS.respond_to?(:join)
CFLAGS.join(' ')
else
CFLAGS
end

flags + ' ' + ARCH_CFLAGS
end
6 changes: 4 additions & 2 deletions storm/include/storm/generic/bit.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
// Abstract: Bit functions.
// Author: Per Lundberg <[email protected]>

// © Copyright 1999-2000, 2013 chaos development.
// © Copyright 1999-2000 chaos development
// © Copyright 2013 chaos development
// © Copyright 2017 chaos development

#pragma once

#if (defined __i386__) || (defined __i486__) || (defined __i586__) || (defined __i686__)
// Little-endian system.
# define BIT_SET(a, b) ((a) |= (1 << (b)))
# define BIT_CLEAR(a, b) ((a) &= !(1 << (b)))
# define BIT_CLEAR(a, b) ((a) &= ~(1 << (b)))
# define BIT_GET(a, b) ((a) & (1 << (b)) ? 1 : 0)
# define BIT_IN_BYTES(a) ((a) % 8 != 0 ? (a) / 8 + 1 : (a) / 8)

Expand Down
2 changes: 1 addition & 1 deletion storm/raspberrypi/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ OUTPUT = 'libstorm_raspberrypi.a'.freeze
GENERIC_OUTPUT = '../generic/libstorm_generic.a'.freeze

KERNEL_OUTPUT = 'storm'.freeze
LDFLAGS = '-nostartfiles'.freeze
LDFLAGS = '-nostdlib'.freeze

task default: [:banner, :prepare, :storm] + objects

Expand Down
28 changes: 14 additions & 14 deletions storm/x86/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@
#define DMA_CHANNEL_CASCADE 4

// Controller registers.
static const unsigned int dma_controller[NUMBER_OF_CONTROLLERS] =
{
0x08, 0xD0
};

static const unsigned int dma_master_reset[NUMBER_OF_CONTROLLERS] =
{
0x0D, 0xDA
};

static const unsigned int dma_master_mask[NUMBER_OF_CONTROLLERS] =
{
0x0F, 0xDE
};
// static const unsigned int dma_controller[NUMBER_OF_CONTROLLERS] =
// {
// 0x08, 0xD0
// };

// static const unsigned int dma_master_reset[NUMBER_OF_CONTROLLERS] =
// {
// 0x0D, 0xDA
// };

// static const unsigned int dma_master_mask[NUMBER_OF_CONTROLLERS] =
// {
// 0x0F, 0xDE
// };

static const unsigned int dma_mask[NUMBER_OF_CONTROLLERS] =
{
Expand Down