diff options
-rw-r--r-- | testing/stlink/APKBUILD | 12 | ||||
-rw-r--r-- | testing/stlink/Compilation-fixes-errors-warnings-552.patch | 140 |
2 files changed, 146 insertions, 6 deletions
diff --git a/testing/stlink/APKBUILD b/testing/stlink/APKBUILD index db21686573..e230764e2c 100644 --- a/testing/stlink/APKBUILD +++ b/testing/stlink/APKBUILD @@ -2,17 +2,18 @@ # Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net> pkgname=stlink pkgver=1.3.0 -pkgrel=1 +pkgrel=2 pkgdesc="STM32 discovery line linux programmer" url="https://github.com/texane/stlink" -arch="all !x86" +arch="all" license="MIT" depends="" depends_dev="" makedepends="cmake libusb-dev" install="" subpackages="$pkgname-doc $pkgname-dev" -source="$pkgname-$pkgver.tar.gz::https://github.com/texane/$pkgname/archive/$pkgver.tar.gz" +source="$pkgname-$pkgver.tar.gz::https://github.com/texane/$pkgname/archive/$pkgver.tar.gz + Compilation-fixes-errors-warnings-552.patch" builddir="$srcdir"/$pkgname-$pkgver build() { @@ -37,6 +38,5 @@ package() { "$pkgdir"/usr/share/doc/$pkgname/ || return 1 } -md5sums="a47bc14deff96988913883d3db0bea80 stlink-1.3.0.tar.gz" -sha256sums="3e8cba21744d2c38a0557f6835a05189e1b98202931bb0183d22efc462c893dd stlink-1.3.0.tar.gz" -sha512sums="4b04d8ba6e4128fa8f7da035dab5b14241c675721388f8cb1771fe5893208abab2a4a69b2de09489f0b453ef2b7d92f65b04f767f81e190ffd53f3fc8e67ce6d stlink-1.3.0.tar.gz" +sha512sums="4b04d8ba6e4128fa8f7da035dab5b14241c675721388f8cb1771fe5893208abab2a4a69b2de09489f0b453ef2b7d92f65b04f767f81e190ffd53f3fc8e67ce6d stlink-1.3.0.tar.gz +8e87bf944e827de758f9d48acb0d2e811a13434fa5624c00e7619cae52a8e996f06226b36fb5057ca064afcab7a3512976bce982aba602b2107a073f9428365d Compilation-fixes-errors-warnings-552.patch" diff --git a/testing/stlink/Compilation-fixes-errors-warnings-552.patch b/testing/stlink/Compilation-fixes-errors-warnings-552.patch new file mode 100644 index 0000000000..ab78197e0e --- /dev/null +++ b/testing/stlink/Compilation-fixes-errors-warnings-552.patch @@ -0,0 +1,140 @@ +From e71a2417c31aeee685a1a6ea22c7b53f6fbd48f8 Mon Sep 17 00:00:00 2001 +From: Bertrand Songis <bsongis@gmail.com> +Date: Mon, 30 Jan 2017 23:16:36 +0100 +Subject: [PATCH] Compilation fixes (errors / warnings) (#552) + +--- + include/stlink/tools/flash.h | 4 +--- + src/common.c | 2 +- + src/gdbserver/semihosting.c | 8 ++++---- + src/tools/flash.c | 4 ++-- + src/tools/gui/CMakeLists.txt | 4 ++-- + tests/flash.c | 2 +- + 6 files changed, 11 insertions(+), 13 deletions(-) + +diff --git a/include/stlink/tools/flash.h b/include/stlink/tools/flash.h +index bb7bd73..6a7b054 100644 +--- a/include/stlink/tools/flash.h ++++ b/include/stlink/tools/flash.h +@@ -22,9 +22,7 @@ struct flash_opts + enum flash_format format; + }; + +- +-#define FLASH_OPTS_INITIALIZER {0, } +- ++#define FLASH_OPTS_INITIALIZER {0, NULL, {}, NULL, 0, 0, 0, 0, 0 } + + int flash_get_opts(struct flash_opts* o, int ac, char** av); + +diff --git a/src/common.c b/src/common.c +index f104a16..ccbbbe2 100644 +--- a/src/common.c ++++ b/src/common.c +@@ -2048,7 +2048,7 @@ int stlink_parse_ihex(const char* path, uint8_t erased_pattern, uint8_t * * mem, + if(e > end) end = e; + } + else { +- for(size_t i = 0; i < reclen; ++i) { ++ for(uint8_t i = 0; i < reclen; ++i) { + uint8_t b = stlink_parse_hex(line + 9 + i*2); + uint32_t addr = lba + offset + i; + if(addr >= *begin && addr <= end) { +diff --git a/src/gdbserver/semihosting.c b/src/gdbserver/semihosting.c +index 4ea6ccf..4be8090 100644 +--- a/src/gdbserver/semihosting.c ++++ b/src/gdbserver/semihosting.c +@@ -247,7 +247,7 @@ int do_semihosting (stlink_t *sl, uint32_t r0, uint32_t r1, uint32_t *ret) { + uint32_t args[3]; + uint32_t buffer_address; + int fd; +- size_t buffer_len; ++ uint32_t buffer_len; + void *buffer; + + if (mem_read(sl, r1, args, sizeof (args)) != 0 ) { +@@ -259,7 +259,7 @@ int do_semihosting (stlink_t *sl, uint32_t r0, uint32_t r1, uint32_t *ret) { + + fd = (int)args[0]; + buffer_address = args[1]; +- buffer_len = (size_t)args[2]; ++ buffer_len = args[2]; + + if (buffer_len > MAX_BUFFER_SIZE) { + DLOG("Semihosting SYS_WRITE error: buffer size is too big %d\n", +@@ -305,7 +305,7 @@ int do_semihosting (stlink_t *sl, uint32_t r0, uint32_t r1, uint32_t *ret) { + uint32_t args[3]; + uint32_t buffer_address; + int fd; +- size_t buffer_len; ++ uint32_t buffer_len; + void *buffer; + + if (mem_read(sl, r1, args, sizeof (args)) != 0 ) { +@@ -317,7 +317,7 @@ int do_semihosting (stlink_t *sl, uint32_t r0, uint32_t r1, uint32_t *ret) { + + fd = (int)args[0]; + buffer_address = args[1]; +- buffer_len = (size_t)args[2]; ++ buffer_len = args[2]; + + if (buffer_len > MAX_BUFFER_SIZE) { + DLOG("Semihosting SYS_READ error: buffer size is too big %d\n", +diff --git a/src/tools/flash.c b/src/tools/flash.c +index 1b6c7a7..f2c186e 100644 +--- a/src/tools/flash.c ++++ b/src/tools/flash.c +@@ -135,7 +135,7 @@ int main(int ac, char** av) + if ((o.addr >= sl->flash_base) && + (o.addr < sl->flash_base + sl->flash_size)) { + if(o.format == FLASH_FORMAT_IHEX) +- err = stlink_mwrite_flash(sl, mem, size, o.addr); ++ err = stlink_mwrite_flash(sl, mem, (uint32_t)size, o.addr); + else + err = stlink_fwrite_flash(sl, o.filename, o.addr); + if (err == -1) +@@ -147,7 +147,7 @@ int main(int ac, char** av) + else if ((o.addr >= sl->sram_base) && + (o.addr < sl->sram_base + sl->sram_size)) { + if(o.format == FLASH_FORMAT_IHEX) +- err = stlink_mwrite_sram(sl, mem, size, o.addr); ++ err = stlink_mwrite_sram(sl, mem, (uint32_t)size, o.addr); + else + err = stlink_fwrite_sram(sl, o.filename, o.addr); + if (err == -1) +diff --git a/src/tools/gui/CMakeLists.txt b/src/tools/gui/CMakeLists.txt +index e217af0..53d1d86 100644 +--- a/src/tools/gui/CMakeLists.txt ++++ b/src/tools/gui/CMakeLists.txt +@@ -10,13 +10,13 @@ include_directories(SYSTEM ${gtk_INCLUDE_DIRS}) + add_executable(stlink-gui-local ${GUI_SOURCES}) + set_target_properties(stlink-gui-local PROPERTIES + COMPILE_FLAGS -DSTLINK_UI_DIR=\\"${CMAKE_CURRENT_SOURCE_DIR}/gui\\") +-target_link_libraries(stlink-gui-local stlink ${gtk_LDFLAGS}) ++target_link_libraries(stlink-gui-local ${STLINK_LIB_STATIC} ${gtk_LDFLAGS}) + + + add_executable(stlink-gui ${GUI_SOURCES}) + set_target_properties(stlink-gui PROPERTIES + COMPILE_FLAGS -DSTLINK_UI_DIR=\\"${CMAKE_INSTALL_PREFIX}/${INSTALLED_UI_DIR}\\") +-target_link_libraries(stlink-gui stlink ${gtk_LDFLAGS}) ++target_link_libraries(stlink-gui ${STLINK_LIB_STATIC} ${gtk_LDFLAGS}) + + install(TARGETS stlink-gui + RUNTIME DESTINATION bin) +diff --git a/tests/flash.c b/tests/flash.c +index 27fd437..fd55fdf 100644 +--- a/tests/flash.c ++++ b/tests/flash.c +@@ -59,7 +59,7 @@ static bool execute_test(const struct Test * test) { + return ret; + } + +-struct Test tests[] = { ++static struct Test tests[] = { + { "", -1, FLASH_OPTS_INITIALIZER }, + { "--debug --reset read /dev/sg0 test.bin 0x80000000 0x1000", 0, + { .cmd = FLASH_CMD_READ, .devname = "/dev/sg0", .serial = {}, .filename = "test.bin", +-- +2.11.1 + |