code
string
repo_name
string
path
string
language
string
license
string
size
int64
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri, 15 May 2015 13:20:01 +0000 (+0000) Subject: [PATCH 9/13] x86 musl support X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=5551c8d927c17f60837f15f8dfe46f945ba3fa9c [PATCH 9/13] x86 musl support On behalf of Szabolcs Nagy. 2015-05-15 Gregor Richards <gregor.richards@uwaterloo.ca> * config/i386/linux.h (MUSL_DYNAMIC_LINKER): Define. * config/i386/linux64.h (MUSL_DYNAMIC_LINKER32): Define. (MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERX32): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223218 138bc75d-0d04-0410-961f-82ee72b054a4 --- Index: b/gcc/config/i386/linux.h =================================================================== --- a/gcc/config/i386/linux.h +++ b/gcc/config/i386/linux.h @@ -21,3 +21,6 @@ #define GNU_USER_LINK_EMULATION "elf_i386" #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" Index: b/gcc/config/i386/linux64.h =================================================================== --- a/gcc/config/i386/linux64.h +++ b/gcc/config/i386/linux64.h @@ -30,3 +30,10 @@ #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" + +#undef MUSL_DYNAMIC_LINKER32 +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1" +#undef MUSL_DYNAMIC_LINKER64 +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1" +#undef MUSL_DYNAMIC_LINKERX32 +#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
shibajee/buildroot
package/gcc/5.4.0/907-x86-musl-support.patch
patch
mit
1,632
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Wed, 27 May 2015 13:17:11 +0000 (+0000) Subject: [PATCH 4/13] arm musl support X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=de799bd087ab9a179768fea75bd195a31d3432a4 [PATCH 4/13] arm musl support On behalf of szabolcs.nagy@arm.com 2015-05-27 Gregor Richards <gregor.richards@uwaterloo.ca> * config/arm/linux-eabi.h (MUSL_DYNAMIC_LINKER): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223749 138bc75d-0d04-0410-961f-82ee72b054a4 --- Index: b/gcc/config/arm/linux-eabi.h =================================================================== --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -77,6 +77,23 @@ %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" +/* For ARM musl currently supports four dynamic linkers: + - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI + - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI + - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB + - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB + musl does not support the legacy OABI mode. + All the dynamic linkers live in /lib. + We default to soft-float, EL. */ +#undef MUSL_DYNAMIC_LINKER +#if TARGET_BIG_ENDIAN_DEFAULT +#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}" +#else +#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}" +#endif +#define MUSL_DYNAMIC_LINKER \ + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to use the GNU/Linux version, not the generic BPABI version. */ #undef LINK_SPEC
shibajee/buildroot
package/gcc/5.4.0/908-arm-musl-support.patch
patch
mit
1,743
From: jgreenhalgh <jgreenhalgh@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Wed, 27 May 2015 16:46:39 +0000 (+0000) Subject: [PATCH 3/13] aarch64 musl support X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=b3ff21cf0531be91bc3fb8200296a7633090ec78 [PATCH 3/13] aarch64 musl support gcc/Changelog: 2015-05-27 Gregor Richards <gregor.richards@uwaterloo.ca> Szabolcs Nagy <szabolcs.nagy@arm.com> * config/aarch64/aarch64-linux.h (MUSL_DYNAMIC_LINKER): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223766 138bc75d-0d04-0410-961f-82ee72b054a4 --- Index: b/gcc/config/aarch64/aarch64-linux.h =================================================================== --- a/gcc/config/aarch64/aarch64-linux.h +++ b/gcc/config/aarch64/aarch64-linux.h @@ -23,6 +23,9 @@ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" + #undef ASAN_CC1_SPEC #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
shibajee/buildroot
package/gcc/5.4.0/909-aarch64-musl-support.patch
patch
mit
1,115
disable split-stack for non-thread builds Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur gcc-5.3.0.orig/libgcc/config/t-stack gcc-5.3.0/libgcc/config/t-stack --- gcc-5.3.0.orig/libgcc/config/t-stack 2010-10-01 21:31:49.000000000 +0200 +++ gcc-5.3.0/libgcc/config/t-stack 2016-03-07 03:25:32.000000000 +0100 @@ -1,4 +1,6 @@ # Makefile fragment to provide generic support for -fsplit-stack. # This should be used in config.host for any host which supports # -fsplit-stack. +ifeq ($(enable_threads),yes) LIB2ADD_ST += $(srcdir)/generic-morestack.c $(srcdir)/generic-morestack-thread.c +endif
shibajee/buildroot
package/gcc/5.4.0/930-libgcc-disable-split-stack-nothreads.patch
patch
mit
609
Enable POSIX threads for uClinux targets Reported upstream: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71721 Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur gcc-5.4.0.orig/gcc/config.gcc gcc-5.4.0/gcc/config.gcc --- gcc-5.4.0.orig/gcc/config.gcc 2015-09-10 16:17:53.000000000 +0200 +++ gcc-5.4.0/gcc/config.gcc 2016-07-01 21:26:02.772958441 +0200 @@ -808,6 +808,9 @@ *-*-uclinux*) extra_options="$extra_options gnu-user.opt" use_gcc_stdint=wrap + case ${enable_threads} in + "" | yes | posix) thread_file='posix' ;; + esac tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC" ;; *-*-rdos*)
shibajee/buildroot
package/gcc/5.4.0/940-uclinux-enable-threads.patch
patch
mit
635
Index: b/contrib/regression/objs-gcc.sh =================================================================== --- a/contrib/regression/objs-gcc.sh +++ b/contrib/regression/objs-gcc.sh @@ -106,6 +106,10 @@ then make all-gdb all-dejagnu all-ld || exit 1 make install-gdb install-dejagnu install-ld || exit 1 +elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ] + then + make all-gdb all-dejagnu all-ld || exit 1 + make install-gdb install-dejagnu install-ld || exit 1 elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then make bootstrap || exit 1 make install || exit 1
shibajee/buildroot
package/gcc/6.1.0/100-uclibc-conf.patch
patch
mit
603
Index: b/boehm-gc/include/gc.h =================================================================== --- a/boehm-gc/include/gc.h +++ b/boehm-gc/include/gc.h @@ -503,7 +503,7 @@ #if defined(__linux__) || defined(__GLIBC__) # include <features.h> # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \ - && !defined(__ia64__) + && !defined(__ia64__) && !defined(__UCLIBC__) # ifndef GC_HAVE_BUILTIN_BACKTRACE # define GC_HAVE_BUILTIN_BACKTRACE # endif
shibajee/buildroot
package/gcc/6.1.0/301-missing-execinfo_h.patch
patch
mit
480
Index: b/gcc/config/arm/linux-elf.h =================================================================== --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -60,7 +60,7 @@ %{shared:-lc} \ %{!shared:%{profile:-lc_p}%{!profile:-lc}}" -#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" +#define LIBGCC_SPEC "-lgcc" #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" Index: b/libgcc/config/arm/t-linux =================================================================== --- a/libgcc/config/arm/t-linux +++ b/libgcc/config/arm/t-linux @@ -1,6 +1,11 @@ LIB1ASMSRC = arm/lib1funcs.S LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ - _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 + _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ + _arm_addsubdf3 _arm_addsubsf3 \ + _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ + _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ + _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ + _arm_fixsfsi _arm_fixunssfsi # Just for these, we omit the frame pointer since it makes such a big # difference.
shibajee/buildroot
package/gcc/6.1.0/810-arm-softfloat-libgcc.patch
patch
mit
1,089
http://sourceware.org/ml/crossgcc/2008-05/msg00009.html Index: b/gcc/config/arm/linux-eabi.h =================================================================== --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -45,7 +45,7 @@ The ARM10TDMI core is the default for armv5t, so set SUBTARGET_CPU_DEFAULT to achieve this. */ #undef SUBTARGET_CPU_DEFAULT -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi /* TARGET_BIG_ENDIAN_DEFAULT is set in config.gcc for big endian configurations. */
shibajee/buildroot
package/gcc/6.1.0/830-arm_unbreak_armv4t.patch
patch
mit
578
[PATCH] cilk: fix build without wchar When building against uClibc with wchar support disabled, WCHAR_MIN and WCHAR_MAX are not defined leading to compilation errors. Fix it by only including the wchar code if available. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> --- libcilkrts/include/cilk/reducer_min_max.h | 8 ++++++++ 1 file changed, 8 insertions(+) Index: b/libcilkrts/include/cilk/reducer_min_max.h =================================================================== --- a/libcilkrts/include/cilk/reducer_min_max.h +++ b/libcilkrts/include/cilk/reducer_min_max.h @@ -3154,7 +3154,9 @@ CILK_C_REDUCER_MAX_INSTANCE(char, char, CHAR_MIN) CILK_C_REDUCER_MAX_INSTANCE(unsigned char, uchar, 0) CILK_C_REDUCER_MAX_INSTANCE(signed char, schar, SCHAR_MIN) +#ifdef WCHAR_MIN CILK_C_REDUCER_MAX_INSTANCE(wchar_t, wchar_t, WCHAR_MIN) +#endif CILK_C_REDUCER_MAX_INSTANCE(short, short, SHRT_MIN) CILK_C_REDUCER_MAX_INSTANCE(unsigned short, ushort, 0) CILK_C_REDUCER_MAX_INSTANCE(int, int, INT_MIN) @@ -3306,7 +3308,9 @@ CILK_C_REDUCER_MAX_INDEX_INSTANCE(char, char, CHAR_MIN) CILK_C_REDUCER_MAX_INDEX_INSTANCE(unsigned char, uchar, 0) CILK_C_REDUCER_MAX_INDEX_INSTANCE(signed char, schar, SCHAR_MIN) +#ifdef WCHAR_MIN CILK_C_REDUCER_MAX_INDEX_INSTANCE(wchar_t, wchar_t, WCHAR_MIN) +#endif CILK_C_REDUCER_MAX_INDEX_INSTANCE(short, short, SHRT_MIN) CILK_C_REDUCER_MAX_INDEX_INSTANCE(unsigned short, ushort, 0) CILK_C_REDUCER_MAX_INDEX_INSTANCE(int, int, INT_MIN) @@ -3432,7 +3436,9 @@ CILK_C_REDUCER_MIN_INSTANCE(char, char, CHAR_MAX) CILK_C_REDUCER_MIN_INSTANCE(unsigned char, uchar, CHAR_MAX) CILK_C_REDUCER_MIN_INSTANCE(signed char, schar, SCHAR_MAX) +#ifdef WCHAR_MAX CILK_C_REDUCER_MIN_INSTANCE(wchar_t, wchar_t, WCHAR_MAX) +#endif CILK_C_REDUCER_MIN_INSTANCE(short, short, SHRT_MAX) CILK_C_REDUCER_MIN_INSTANCE(unsigned short, ushort, USHRT_MAX) CILK_C_REDUCER_MIN_INSTANCE(int, int, INT_MAX) @@ -3584,7 +3590,9 @@ CILK_C_REDUCER_MIN_INDEX_INSTANCE(char, char, CHAR_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(unsigned char, uchar, CHAR_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(signed char, schar, SCHAR_MAX) +#ifdef WCHAR_MAX CILK_C_REDUCER_MIN_INDEX_INSTANCE(wchar_t, wchar_t, WCHAR_MAX) +#endif CILK_C_REDUCER_MIN_INDEX_INSTANCE(short, short, SHRT_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(unsigned short, ushort, USHRT_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(int, int, INT_MAX)
shibajee/buildroot
package/gcc/6.1.0/860-cilk-wchar.patch
patch
mit
2,831
remove unused header, which breaks the toolchain building Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur gcc-5.3.0.orig/libgcc/config/m68k/linux-atomic.c gcc-5.3.0/libgcc/config/m68k/linux-atomic.c --- gcc-5.3.0.orig/libgcc/config/m68k/linux-atomic.c 2015-01-05 13:33:28.000000000 +0100 +++ gcc-5.3.0/libgcc/config/m68k/linux-atomic.c 2016-03-19 09:25:07.000000000 +0100 @@ -33,7 +33,6 @@ using the kernel helper defined below. There is no support for 64-bit operations yet. */ -#include <asm/unistd.h> #include <stdbool.h> #ifndef __NR_atomic_cmpxchg_32
shibajee/buildroot
package/gcc/6.1.0/890-fix-m68k-compile.patch
patch
mit
587
avoids internal compiler error while compiling linux-atomic.c See here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53833 Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur gcc-6.1.0.orig/libgcc/config.host gcc-6.1.0/libgcc/config.host --- gcc-6.1.0.orig/libgcc/config.host 2016-02-26 21:02:28.000000000 +0100 +++ gcc-6.1.0/libgcc/config.host 2016-04-29 09:18:40.377989160 +0200 @@ -812,7 +812,7 @@ m68k*-*-openbsd*) ;; m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux with uClibc - tmake_file="$tmake_file m68k/t-floatlib m68k/t-linux" + tmake_file="$tmake_file m68k/t-floatlib" md_unwind_header=m68k/linux-unwind.h ;; m68k-*-linux*) # Motorola m68k's running GNU/Linux
shibajee/buildroot
package/gcc/6.1.0/891-fix-m68k-uclinux.patch
patch
mit
704
From ae9c3e354440c4a0f105a9eabfb2f77be085ebc1 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Date: Thu, 18 Aug 2016 17:59:16 +0200 Subject: [PATCH] libgcc/mkmap-symver: support skip_underscore Some platforms, such as Blackfin, have a special prefix for assembly symbols as opposed to C symbols. For this reason, a function named "foo()" in C will in fact be visible as a symbol called "_foo" in the ELF binary. The current linker version script logic in libgcc doesn't take into account this situation properly. The Blackfin specific libgcc/config/bfin/libgcc-glibc.ver has an additional "_" in front of every symbol so that it matches the output of "nm" (which gets parsed to produce the final linker version script). But due to this additional "_", ld no longer matches with the symbols since "ld" does the matching with the original symbol name, not the one prefixed with "_". Due to this, none of the symbols in libgcc/config/bfin/libgcc-glibc.ver are actually matched with symbols in libgcc. This causes all libgcc symbols to be left as "LOCAL", which causes lots of "undefined reference" whenever some C or C++ code that calls a function of libgcc is compiled. To address this, this commit introduces a "skip_underscore" variable to the mkmap-symver script. It tells mkmap-symver to ignore the leading underscore from the "nm" output. Note that this new argument is different from the existing "leading_underscore" argument, which *adds* an additional underscore to the generated linker version script. Having this functionality paves the way to using the generic linker version information for Blackfin, instead of using a custom one. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- libgcc/ChangeLog | 5 +++++ libgcc/mkmap-symver.awk | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 6559564..129e43f 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2016-08-19 Thomas Petazzoni <thomas.petazzoni@free-electrons.com> + + PR gcc/74748 + * libgcc/mkmap-symver.awk: add support for skip_underscore + 2016-04-27 Release Manager * GCC 6.1.0 released. diff --git a/libgcc/mkmap-symver.awk b/libgcc/mkmap-symver.awk index 266832a..30bb179 100644 --- a/libgcc/mkmap-symver.awk +++ b/libgcc/mkmap-symver.awk @@ -47,7 +47,11 @@ state == "nm" && ($1 == "U" || $2 == "U") { state == "nm" && NF == 3 { split ($3, s, "@") - def[s[1]] = 1; + if (skip_underscore) + symname = substr(s[1], 2); + else + symname = s[1]; + def[symname] = 1; sawsymbol = 1; next; } -- 2.7.4
shibajee/buildroot
package/gcc/6.1.0/892-libgcc-mkmap-symver-support-skip_underscore.patch
patch
mit
2,665
From 56d606931716de30a89a40dc69a9282c1b4e2880 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Date: Thu, 18 Aug 2016 18:04:06 +0200 Subject: [PATCH] libgcc/config/bfin: use the generic linker version information This commit makes the Blackfin platform use the generic linker version information, rather than a completely duplicated file, specific for the Blackfin architecture. This is made possible using the newly introduced skip_underscore variable of the mkmap-symver script. This also allows to get a correct linker version file, with symbol names matching the ones found in libgcc. Thanks to this, the necessary symbols are marked "GLOBAL" instead of "LOCAL", which makes them visible at link time, and solves a large number of "undefined reference" issues. Indeed, the Blackfin specific linker version script had an extra underscore in front of all symbols, which meant none of them matched the symbols in libgcc, and therefore all libgcc symbols were marked as "LOCAL", making them invisible for linking. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- libgcc/ChangeLog | 6 + libgcc/config/bfin/libgcc-glibc.ver | 1894 +---------------------------------- libgcc/config/bfin/t-linux | 3 +- 3 files changed, 10 insertions(+), 1893 deletions(-) diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 129e43f..36c0194 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,6 +1,12 @@ 2016-08-19 Thomas Petazzoni <thomas.petazzoni@free-electrons.com> PR gcc/74748 + * libgcc/config/bfin/libgcc-glibc.ver, libgcc/config/bfin/t-linux: + use generic linker version information on Blackfin. + +2016-08-19 Thomas Petazzoni <thomas.petazzoni@free-electrons.com> + + PR gcc/74748 * libgcc/mkmap-symver.awk: add support for skip_underscore 2016-04-27 Release Manager diff --git a/libgcc/config/bfin/libgcc-glibc.ver b/libgcc/config/bfin/libgcc-glibc.ver index b1bd2df..2af3df7 100644 --- a/libgcc/config/bfin/libgcc-glibc.ver +++ b/libgcc/config/bfin/libgcc-glibc.ver @@ -16,1898 +16,8 @@ # along with GCC; see the file COPYING3. If not see # <http://www.gnu.org/licenses/>. -GCC_3.0 { - # libgcc1 integer symbols - ___absvsi2 - ___addvsi3 - ___ashlsi3 - ___ashrsi3 - ___divsi3 - ___lshrsi3 - ___modsi3 - ___mulsi3 - ___mulvsi3 - ___negvsi2 - ___subvsi3 - ___udivsi3 - ___umodsi3 - - # libgcc1 floating point symbols - ___addsf3 - ___adddf3 - ___addxf3 - ___addtf3 - ___divsf3 - ___divdf3 - ___divxf3 - ___divtf3 - ___eqsf2 - ___eqdf2 - ___eqxf2 - ___eqtf2 - ___extenddfxf2 - ___extenddftf2 - ___extendsfdf2 - ___extendsfxf2 - ___extendsftf2 - ___fixsfsi - ___fixdfsi - ___fixxfsi - ___fixtfsi - ___floatsisf - ___floatsidf - ___floatsixf - ___floatsitf - ___gesf2 - ___gedf2 - ___gexf2 - ___getf2 - ___gtsf2 - ___gtdf2 - ___gtxf2 - ___gttf2 - ___lesf2 - ___ledf2 - ___lexf2 - ___letf2 - ___ltsf2 - ___ltdf2 - ___ltxf2 - ___lttf2 - ___mulsf3 - ___muldf3 - ___mulxf3 - ___multf3 - ___negsf2 - ___negdf2 - ___negxf2 - ___negtf2 - ___nesf2 - ___nedf2 - ___nexf2 - ___netf2 - ___subsf3 - ___subdf3 - ___subxf3 - ___subtf3 - ___truncdfsf2 - ___truncxfsf2 - ___trunctfsf2 - ___truncxfdf2 - ___trunctfdf2 - - # libgcc2 DImode arithmetic (for 32-bit targets). - ___absvdi2 - ___addvdi3 - ___ashldi3 - ___ashrdi3 - ___cmpdi2 - ___divdi3 - ___ffsdi2 - ___fixdfdi - ___fixsfdi - ___fixtfdi - ___fixxfdi - ___fixunsdfdi - ___fixunsdfsi - ___fixunssfsi - ___fixunssfdi - ___fixunstfdi - ___fixunstfsi - ___fixunsxfdi - ___fixunsxfsi - ___floatdidf - ___floatdisf - ___floatdixf - ___floatditf - ___lshrdi3 - ___moddi3 - ___muldi3 - ___mulvdi3 - ___negdi2 - ___negvdi2 - ___subvdi3 - ___ucmpdi2 - ___udivdi3 - ___udivmoddi4 - ___umoddi3 - - # libgcc2 TImode arithmetic (for 64-bit targets). - ___ashlti3 - ___ashrti3 - ___cmpti2 - ___divti3 - ___ffsti2 - ___fixdfti - ___fixsfti - ___fixtfti - ___fixxfti - ___lshrti3 - ___modti3 - ___multi3 - ___negti2 - ___ucmpti2 - ___udivmodti4 - ___udivti3 - ___umodti3 - ___fixunsdfti - ___fixunssfti - ___fixunstfti - ___fixunsxfti - ___floattidf - ___floattisf - ___floattixf - ___floattitf - - # Used to deal with trampoline initialization on some platforms - ___clear_cache - - # EH symbols - __Unwind_DeleteException - __Unwind_Find_FDE - __Unwind_ForcedUnwind - __Unwind_GetGR - __Unwind_GetIP - __Unwind_GetLanguageSpecificData - __Unwind_GetRegionStart - __Unwind_GetTextRelBase - __Unwind_GetDataRelBase - __Unwind_RaiseException - __Unwind_Resume - __Unwind_SetGR - __Unwind_SetIP - ___deregister_frame - ___deregister_frame_info - ___deregister_frame_info_bases - ___register_frame - ___register_frame_info - ___register_frame_info_bases - ___register_frame_info_table - ___register_frame_info_table_bases - ___register_frame_table - - # SjLj EH symbols - __Unwind_SjLj_Register - __Unwind_SjLj_Unregister - __Unwind_SjLj_RaiseException - __Unwind_SjLj_ForcedUnwind - __Unwind_SjLj_Resume -} - -%inherit GCC_3.3 GCC_3.0 -GCC_3.3 { - __Unwind_FindEnclosingFunction - __Unwind_GetCFA - __Unwind_Backtrace - __Unwind_Resume_or_Rethrow - __Unwind_SjLj_Resume_or_Rethrow -} - -%inherit GCC_3.3.1 GCC_3.3 -GCC_3.3.1 { - ___gcc_personality_sj0 - ___gcc_personality_v0 -} - -%inherit GCC_3.3.2 GCC_3.3.1 -GCC_3.3.2 { -} -%inherit GCC_3.3.4 GCC_3.3.2 -GCC_3.3.4 { - ___unorddf2 - ___unordsf2 -} - -%inherit GCC_3.4 GCC_3.3.4 -GCC_3.4 { - # bit scanning and counting built-ins - ___clzsi2 - ___clzdi2 - ___clzti2 - ___ctzsi2 - ___ctzdi2 - ___ctzti2 - ___popcountsi2 - ___popcountdi2 - ___popcountti2 - ___paritysi2 - ___paritydi2 - ___parityti2 -} - -%inherit GCC_3.4.2 GCC_3.4 -GCC_3.4.2 { - # Used to deal with trampoline initialization on some platforms - ___enable_execute_stack - ___trampoline_setup -} - -%inherit GCC_3.4.4 GCC_3.4.2 -GCC_3.4.4 { - # libgcc2 TImode arithmetic (for 64-bit targets). - ___absvti2 - ___addvti3 - ___mulvti3 - ___negvti2 - ___subvti3 -} - -%inherit GCC_4.0.0 GCC_3.4.4 -GCC_4.0.0 { - # libgcc2 __builtin_powi helpers. - ___powisf2 - ___powidf2 - ___powixf2 - ___powitf2 - - # c99 compliant complex arithmetic - ___divsc3 - ___divdc3 - ___divxc3 - ___divtc3 - ___mulsc3 - ___muldc3 - ___mulxc3 - ___multc3 -} - %inherit GCC_4.1.0 GCC_4.0.0 GCC_4.1.0 { - ___smulsi3_highpart - ___umulsi3_highpart -} - -%inherit GCC_4.2.0 GCC_4.1.0 -GCC_4.2.0 { - # unsigned-to-floating conversions - ___floatunsisf - ___floatunsidf - ___floatunsixf - ___floatunsitf - ___floatundidf - ___floatundisf - ___floatundixf - ___floatunditf - ___floatuntidf - ___floatuntisf - ___floatuntixf - ___floatuntitf - __Unwind_GetIPInfo -} - -%inherit GCC_4.3.0 GCC_4.2.0 -GCC_4.3.0 { - # byte swapping routines - ___bswapsi2 - ___bswapdi2 - ___emutls_get_address - ___emutls_register_common - ___ffssi2 - ___extendxftf2 - ___trunctfxf2 - - # fixed-point routines - ___addqq3 - ___addhq3 - ___addsq3 - ___adddq3 - ___addtq3 - ___adduqq3 - ___adduhq3 - ___addusq3 - ___addudq3 - ___addutq3 - ___addha3 - ___addsa3 - ___addda3 - ___addta3 - ___adduha3 - ___addusa3 - ___adduda3 - ___adduta3 - ___ssaddqq3 - ___ssaddhq3 - ___ssaddsq3 - ___ssadddq3 - ___ssaddtq3 - ___ssaddha3 - ___ssaddsa3 - ___ssaddda3 - ___ssaddta3 - ___usadduqq3 - ___usadduhq3 - ___usaddusq3 - ___usaddudq3 - ___usaddutq3 - ___usadduha3 - ___usaddusa3 - ___usadduda3 - ___usadduta3 - ___subqq3 - ___subhq3 - ___subsq3 - ___subdq3 - ___subtq3 - ___subuqq3 - ___subuhq3 - ___subusq3 - ___subudq3 - ___subutq3 - ___subha3 - ___subsa3 - ___subda3 - ___subta3 - ___subuha3 - ___subusa3 - ___subuda3 - ___subuta3 - ___sssubqq3 - ___sssubhq3 - ___sssubsq3 - ___sssubdq3 - ___sssubtq3 - ___sssubha3 - ___sssubsa3 - ___sssubda3 - ___sssubta3 - ___ussubuqq3 - ___ussubuhq3 - ___ussubusq3 - ___ussubudq3 - ___ussubutq3 - ___ussubuha3 - ___ussubusa3 - ___ussubuda3 - ___ussubuta3 - ___mulqq3 - ___mulhq3 - ___mulsq3 - ___muldq3 - ___multq3 - ___muluqq3 - ___muluhq3 - ___mulusq3 - ___muludq3 - ___mulutq3 - ___mulha3 - ___mulsa3 - ___mulda3 - ___multa3 - ___muluha3 - ___mulusa3 - ___muluda3 - ___muluta3 - ___ssmulqq3 - ___ssmulhq3 - ___ssmulsq3 - ___ssmuldq3 - ___ssmultq3 - ___ssmulha3 - ___ssmulsa3 - ___ssmulda3 - ___ssmulta3 - ___usmuluqq3 - ___usmuluhq3 - ___usmulusq3 - ___usmuludq3 - ___usmulutq3 - ___usmuluha3 - ___usmulusa3 - ___usmuluda3 - ___usmuluta3 - ___divqq3 - ___divhq3 - ___divsq3 - ___divdq3 - ___divtq3 - ___divha3 - ___divsa3 - ___divda3 - ___divta3 - ___udivuqq3 - ___udivuhq3 - ___udivusq3 - ___udivudq3 - ___udivutq3 - ___udivuha3 - ___udivusa3 - ___udivuda3 - ___udivuta3 - ___ssdivqq3 - ___ssdivhq3 - ___ssdivsq3 - ___ssdivdq3 - ___ssdivtq3 - ___ssdivha3 - ___ssdivsa3 - ___ssdivda3 - ___ssdivta3 - ___usdivuqq3 - ___usdivuhq3 - ___usdivusq3 - ___usdivudq3 - ___usdivutq3 - ___usdivuha3 - ___usdivusa3 - ___usdivuda3 - ___usdivuta3 - ___negqq2 - ___neghq2 - ___negsq2 - ___negdq2 - ___negtq2 - ___neguqq2 - ___neguhq2 - ___negusq2 - ___negudq2 - ___negutq2 - ___negha2 - ___negsa2 - ___negda2 - ___negta2 - ___neguha2 - ___negusa2 - ___neguda2 - ___neguta2 - ___ssnegqq2 - ___ssneghq2 - ___ssnegsq2 - ___ssnegdq2 - ___ssnegtq2 - ___ssnegha2 - ___ssnegsa2 - ___ssnegda2 - ___ssnegta2 - ___usneguqq2 - ___usneguhq2 - ___usnegusq2 - ___usnegudq2 - ___usnegutq2 - ___usneguha2 - ___usnegusa2 - ___usneguda2 - ___usneguta2 - ___ashlqq3 - ___ashlhq3 - ___ashlsq3 - ___ashldq3 - ___ashltq3 - ___ashluqq3 - ___ashluhq3 - ___ashlusq3 - ___ashludq3 - ___ashlutq3 - ___ashlha3 - ___ashlsa3 - ___ashlda3 - ___ashlta3 - ___ashluha3 - ___ashlusa3 - ___ashluda3 - ___ashluta3 - ___ashrqq3 - ___ashrhq3 - ___ashrsq3 - ___ashrdq3 - ___ashrtq3 - ___ashrha3 - ___ashrsa3 - ___ashrda3 - ___ashrta3 - ___lshruqq3 - ___lshruhq3 - ___lshrusq3 - ___lshrudq3 - ___lshrutq3 - ___lshruha3 - ___lshrusa3 - ___lshruda3 - ___lshruta3 - ___ssashlqq3 - ___ssashlhq3 - ___ssashlsq3 - ___ssashldq3 - ___ssashltq3 - ___ssashlha3 - ___ssashlsa3 - ___ssashlda3 - ___ssashlta3 - ___usashluqq3 - ___usashluhq3 - ___usashlusq3 - ___usashludq3 - ___usashlutq3 - ___usashluha3 - ___usashlusa3 - ___usashluda3 - ___usashluta3 - ___cmpqq2 - ___cmphq2 - ___cmpsq2 - ___cmpdq2 - ___cmptq2 - ___cmpuqq2 - ___cmpuhq2 - ___cmpusq2 - ___cmpudq2 - ___cmputq2 - ___cmpha2 - ___cmpsa2 - ___cmpda2 - ___cmpta2 - ___cmpuha2 - ___cmpusa2 - ___cmpuda2 - ___cmputa2 - ___fractqqhq2 - ___fractqqsq2 - ___fractqqdq2 - ___fractqqtq2 - ___fractqqha - ___fractqqsa - ___fractqqda - ___fractqqta - ___fractqquqq - ___fractqquhq - ___fractqqusq - ___fractqqudq - ___fractqqutq - ___fractqquha - ___fractqqusa - ___fractqquda - ___fractqquta - ___fractqqqi - ___fractqqhi - ___fractqqsi - ___fractqqdi - ___fractqqti - ___fractqqsf - ___fractqqdf - ___fracthqqq2 - ___fracthqsq2 - ___fracthqdq2 - ___fracthqtq2 - ___fracthqha - ___fracthqsa - ___fracthqda - ___fracthqta - ___fracthquqq - ___fracthquhq - ___fracthqusq - ___fracthqudq - ___fracthqutq - ___fracthquha - ___fracthqusa - ___fracthquda - ___fracthquta - ___fracthqqi - ___fracthqhi - ___fracthqsi - ___fracthqdi - ___fracthqti - ___fracthqsf - ___fracthqdf - ___fractsqqq2 - ___fractsqhq2 - ___fractsqdq2 - ___fractsqtq2 - ___fractsqha - ___fractsqsa - ___fractsqda - ___fractsqta - ___fractsquqq - ___fractsquhq - ___fractsqusq - ___fractsqudq - ___fractsqutq - ___fractsquha - ___fractsqusa - ___fractsquda - ___fractsquta - ___fractsqqi - ___fractsqhi - ___fractsqsi - ___fractsqdi - ___fractsqti - ___fractsqsf - ___fractsqdf - ___fractdqqq2 - ___fractdqhq2 - ___fractdqsq2 - ___fractdqtq2 - ___fractdqha - ___fractdqsa - ___fractdqda - ___fractdqta - ___fractdquqq - ___fractdquhq - ___fractdqusq - ___fractdqudq - ___fractdqutq - ___fractdquha - ___fractdqusa - ___fractdquda - ___fractdquta - ___fractdqqi - ___fractdqhi - ___fractdqsi - ___fractdqdi - ___fractdqti - ___fractdqsf - ___fractdqdf - ___fracttqqq2 - ___fracttqhq2 - ___fracttqsq2 - ___fracttqdq2 - ___fracttqha - ___fracttqsa - ___fracttqda - ___fracttqta - ___fracttquqq - ___fracttquhq - ___fracttqusq - ___fracttqudq - ___fracttqutq - ___fracttquha - ___fracttqusa - ___fracttquda - ___fracttquta - ___fracttqqi - ___fracttqhi - ___fracttqsi - ___fracttqdi - ___fracttqti - ___fracttqsf - ___fracttqdf - ___fracthaqq - ___fracthahq - ___fracthasq - ___fracthadq - ___fracthatq - ___fracthasa2 - ___fracthada2 - ___fracthata2 - ___fracthauqq - ___fracthauhq - ___fracthausq - ___fracthaudq - ___fracthautq - ___fracthauha - ___fracthausa - ___fracthauda - ___fracthauta - ___fracthaqi - ___fracthahi - ___fracthasi - ___fracthadi - ___fracthati - ___fracthasf - ___fracthadf - ___fractsaqq - ___fractsahq - ___fractsasq - ___fractsadq - ___fractsatq - ___fractsaha2 - ___fractsada2 - ___fractsata2 - ___fractsauqq - ___fractsauhq - ___fractsausq - ___fractsaudq - ___fractsautq - ___fractsauha - ___fractsausa - ___fractsauda - ___fractsauta - ___fractsaqi - ___fractsahi - ___fractsasi - ___fractsadi - ___fractsati - ___fractsasf - ___fractsadf - ___fractdaqq - ___fractdahq - ___fractdasq - ___fractdadq - ___fractdatq - ___fractdaha2 - ___fractdasa2 - ___fractdata2 - ___fractdauqq - ___fractdauhq - ___fractdausq - ___fractdaudq - ___fractdautq - ___fractdauha - ___fractdausa - ___fractdauda - ___fractdauta - ___fractdaqi - ___fractdahi - ___fractdasi - ___fractdadi - ___fractdati - ___fractdasf - ___fractdadf - ___fracttaqq - ___fracttahq - ___fracttasq - ___fracttadq - ___fracttatq - ___fracttaha2 - ___fracttasa2 - ___fracttada2 - ___fracttauqq - ___fracttauhq - ___fracttausq - ___fracttaudq - ___fracttautq - ___fracttauha - ___fracttausa - ___fracttauda - ___fracttauta - ___fracttaqi - ___fracttahi - ___fracttasi - ___fracttadi - ___fracttati - ___fracttasf - ___fracttadf - ___fractuqqqq - ___fractuqqhq - ___fractuqqsq - ___fractuqqdq - ___fractuqqtq - ___fractuqqha - ___fractuqqsa - ___fractuqqda - ___fractuqqta - ___fractuqquhq2 - ___fractuqqusq2 - ___fractuqqudq2 - ___fractuqqutq2 - ___fractuqquha - ___fractuqqusa - ___fractuqquda - ___fractuqquta - ___fractuqqqi - ___fractuqqhi - ___fractuqqsi - ___fractuqqdi - ___fractuqqti - ___fractuqqsf - ___fractuqqdf - ___fractuhqqq - ___fractuhqhq - ___fractuhqsq - ___fractuhqdq - ___fractuhqtq - ___fractuhqha - ___fractuhqsa - ___fractuhqda - ___fractuhqta - ___fractuhquqq2 - ___fractuhqusq2 - ___fractuhqudq2 - ___fractuhqutq2 - ___fractuhquha - ___fractuhqusa - ___fractuhquda - ___fractuhquta - ___fractuhqqi - ___fractuhqhi - ___fractuhqsi - ___fractuhqdi - ___fractuhqti - ___fractuhqsf - ___fractuhqdf - ___fractusqqq - ___fractusqhq - ___fractusqsq - ___fractusqdq - ___fractusqtq - ___fractusqha - ___fractusqsa - ___fractusqda - ___fractusqta - ___fractusquqq2 - ___fractusquhq2 - ___fractusqudq2 - ___fractusqutq2 - ___fractusquha - ___fractusqusa - ___fractusquda - ___fractusquta - ___fractusqqi - ___fractusqhi - ___fractusqsi - ___fractusqdi - ___fractusqti - ___fractusqsf - ___fractusqdf - ___fractudqqq - ___fractudqhq - ___fractudqsq - ___fractudqdq - ___fractudqtq - ___fractudqha - ___fractudqsa - ___fractudqda - ___fractudqta - ___fractudquqq2 - ___fractudquhq2 - ___fractudqusq2 - ___fractudqutq2 - ___fractudquha - ___fractudqusa - ___fractudquda - ___fractudquta - ___fractudqqi - ___fractudqhi - ___fractudqsi - ___fractudqdi - ___fractudqti - ___fractudqsf - ___fractudqdf - ___fractutqqq - ___fractutqhq - ___fractutqsq - ___fractutqdq - ___fractutqtq - ___fractutqha - ___fractutqsa - ___fractutqda - ___fractutqta - ___fractutquqq2 - ___fractutquhq2 - ___fractutqusq2 - ___fractutqudq2 - ___fractutquha - ___fractutqusa - ___fractutquda - ___fractutquta - ___fractutqqi - ___fractutqhi - ___fractutqsi - ___fractutqdi - ___fractutqti - ___fractutqsf - ___fractutqdf - ___fractuhaqq - ___fractuhahq - ___fractuhasq - ___fractuhadq - ___fractuhatq - ___fractuhaha - ___fractuhasa - ___fractuhada - ___fractuhata - ___fractuhauqq - ___fractuhauhq - ___fractuhausq - ___fractuhaudq - ___fractuhautq - ___fractuhausa2 - ___fractuhauda2 - ___fractuhauta2 - ___fractuhaqi - ___fractuhahi - ___fractuhasi - ___fractuhadi - ___fractuhati - ___fractuhasf - ___fractuhadf - ___fractusaqq - ___fractusahq - ___fractusasq - ___fractusadq - ___fractusatq - ___fractusaha - ___fractusasa - ___fractusada - ___fractusata - ___fractusauqq - ___fractusauhq - ___fractusausq - ___fractusaudq - ___fractusautq - ___fractusauha2 - ___fractusauda2 - ___fractusauta2 - ___fractusaqi - ___fractusahi - ___fractusasi - ___fractusadi - ___fractusati - ___fractusasf - ___fractusadf - ___fractudaqq - ___fractudahq - ___fractudasq - ___fractudadq - ___fractudatq - ___fractudaha - ___fractudasa - ___fractudada - ___fractudata - ___fractudauqq - ___fractudauhq - ___fractudausq - ___fractudaudq - ___fractudautq - ___fractudauha2 - ___fractudausa2 - ___fractudauta2 - ___fractudaqi - ___fractudahi - ___fractudasi - ___fractudadi - ___fractudati - ___fractudasf - ___fractudadf - ___fractutaqq - ___fractutahq - ___fractutasq - ___fractutadq - ___fractutatq - ___fractutaha - ___fractutasa - ___fractutada - ___fractutata - ___fractutauqq - ___fractutauhq - ___fractutausq - ___fractutaudq - ___fractutautq - ___fractutauha2 - ___fractutausa2 - ___fractutauda2 - ___fractutaqi - ___fractutahi - ___fractutasi - ___fractutadi - ___fractutati - ___fractutasf - ___fractutadf - ___fractqiqq - ___fractqihq - ___fractqisq - ___fractqidq - ___fractqitq - ___fractqiha - ___fractqisa - ___fractqida - ___fractqita - ___fractqiuqq - ___fractqiuhq - ___fractqiusq - ___fractqiudq - ___fractqiutq - ___fractqiuha - ___fractqiusa - ___fractqiuda - ___fractqiuta - ___fracthiqq - ___fracthihq - ___fracthisq - ___fracthidq - ___fracthitq - ___fracthiha - ___fracthisa - ___fracthida - ___fracthita - ___fracthiuqq - ___fracthiuhq - ___fracthiusq - ___fracthiudq - ___fracthiutq - ___fracthiuha - ___fracthiusa - ___fracthiuda - ___fracthiuta - ___fractsiqq - ___fractsihq - ___fractsisq - ___fractsidq - ___fractsitq - ___fractsiha - ___fractsisa - ___fractsida - ___fractsita - ___fractsiuqq - ___fractsiuhq - ___fractsiusq - ___fractsiudq - ___fractsiutq - ___fractsiuha - ___fractsiusa - ___fractsiuda - ___fractsiuta - ___fractdiqq - ___fractdihq - ___fractdisq - ___fractdidq - ___fractditq - ___fractdiha - ___fractdisa - ___fractdida - ___fractdita - ___fractdiuqq - ___fractdiuhq - ___fractdiusq - ___fractdiudq - ___fractdiutq - ___fractdiuha - ___fractdiusa - ___fractdiuda - ___fractdiuta - ___fracttiqq - ___fracttihq - ___fracttisq - ___fracttidq - ___fracttitq - ___fracttiha - ___fracttisa - ___fracttida - ___fracttita - ___fracttiuqq - ___fracttiuhq - ___fracttiusq - ___fracttiudq - ___fracttiutq - ___fracttiuha - ___fracttiusa - ___fracttiuda - ___fracttiuta - ___fractsfqq - ___fractsfhq - ___fractsfsq - ___fractsfdq - ___fractsftq - ___fractsfha - ___fractsfsa - ___fractsfda - ___fractsfta - ___fractsfuqq - ___fractsfuhq - ___fractsfusq - ___fractsfudq - ___fractsfutq - ___fractsfuha - ___fractsfusa - ___fractsfuda - ___fractsfuta - ___fractdfqq - ___fractdfhq - ___fractdfsq - ___fractdfdq - ___fractdftq - ___fractdfha - ___fractdfsa - ___fractdfda - ___fractdfta - ___fractdfuqq - ___fractdfuhq - ___fractdfusq - ___fractdfudq - ___fractdfutq - ___fractdfuha - ___fractdfusa - ___fractdfuda - ___fractdfuta - ___satfractqqhq2 - ___satfractqqsq2 - ___satfractqqdq2 - ___satfractqqtq2 - ___satfractqqha - ___satfractqqsa - ___satfractqqda - ___satfractqqta - ___satfractqquqq - ___satfractqquhq - ___satfractqqusq - ___satfractqqudq - ___satfractqqutq - ___satfractqquha - ___satfractqqusa - ___satfractqquda - ___satfractqquta - ___satfracthqqq2 - ___satfracthqsq2 - ___satfracthqdq2 - ___satfracthqtq2 - ___satfracthqha - ___satfracthqsa - ___satfracthqda - ___satfracthqta - ___satfracthquqq - ___satfracthquhq - ___satfracthqusq - ___satfracthqudq - ___satfracthqutq - ___satfracthquha - ___satfracthqusa - ___satfracthquda - ___satfracthquta - ___satfractsqqq2 - ___satfractsqhq2 - ___satfractsqdq2 - ___satfractsqtq2 - ___satfractsqha - ___satfractsqsa - ___satfractsqda - ___satfractsqta - ___satfractsquqq - ___satfractsquhq - ___satfractsqusq - ___satfractsqudq - ___satfractsqutq - ___satfractsquha - ___satfractsqusa - ___satfractsquda - ___satfractsquta - ___satfractdqqq2 - ___satfractdqhq2 - ___satfractdqsq2 - ___satfractdqtq2 - ___satfractdqha - ___satfractdqsa - ___satfractdqda - ___satfractdqta - ___satfractdquqq - ___satfractdquhq - ___satfractdqusq - ___satfractdqudq - ___satfractdqutq - ___satfractdquha - ___satfractdqusa - ___satfractdquda - ___satfractdquta - ___satfracttqqq2 - ___satfracttqhq2 - ___satfracttqsq2 - ___satfracttqdq2 - ___satfracttqha - ___satfracttqsa - ___satfracttqda - ___satfracttqta - ___satfracttquqq - ___satfracttquhq - ___satfracttqusq - ___satfracttqudq - ___satfracttqutq - ___satfracttquha - ___satfracttqusa - ___satfracttquda - ___satfracttquta - ___satfracthaqq - ___satfracthahq - ___satfracthasq - ___satfracthadq - ___satfracthatq - ___satfracthasa2 - ___satfracthada2 - ___satfracthata2 - ___satfracthauqq - ___satfracthauhq - ___satfracthausq - ___satfracthaudq - ___satfracthautq - ___satfracthauha - ___satfracthausa - ___satfracthauda - ___satfracthauta - ___satfractsaqq - ___satfractsahq - ___satfractsasq - ___satfractsadq - ___satfractsatq - ___satfractsaha2 - ___satfractsada2 - ___satfractsata2 - ___satfractsauqq - ___satfractsauhq - ___satfractsausq - ___satfractsaudq - ___satfractsautq - ___satfractsauha - ___satfractsausa - ___satfractsauda - ___satfractsauta - ___satfractdaqq - ___satfractdahq - ___satfractdasq - ___satfractdadq - ___satfractdatq - ___satfractdaha2 - ___satfractdasa2 - ___satfractdata2 - ___satfractdauqq - ___satfractdauhq - ___satfractdausq - ___satfractdaudq - ___satfractdautq - ___satfractdauha - ___satfractdausa - ___satfractdauda - ___satfractdauta - ___satfracttaqq - ___satfracttahq - ___satfracttasq - ___satfracttadq - ___satfracttatq - ___satfracttaha2 - ___satfracttasa2 - ___satfracttada2 - ___satfracttauqq - ___satfracttauhq - ___satfracttausq - ___satfracttaudq - ___satfracttautq - ___satfracttauha - ___satfracttausa - ___satfracttauda - ___satfracttauta - ___satfractuqqqq - ___satfractuqqhq - ___satfractuqqsq - ___satfractuqqdq - ___satfractuqqtq - ___satfractuqqha - ___satfractuqqsa - ___satfractuqqda - ___satfractuqqta - ___satfractuqquhq2 - ___satfractuqqusq2 - ___satfractuqqudq2 - ___satfractuqqutq2 - ___satfractuqquha - ___satfractuqqusa - ___satfractuqquda - ___satfractuqquta - ___satfractuhqqq - ___satfractuhqhq - ___satfractuhqsq - ___satfractuhqdq - ___satfractuhqtq - ___satfractuhqha - ___satfractuhqsa - ___satfractuhqda - ___satfractuhqta - ___satfractuhquqq2 - ___satfractuhqusq2 - ___satfractuhqudq2 - ___satfractuhqutq2 - ___satfractuhquha - ___satfractuhqusa - ___satfractuhquda - ___satfractuhquta - ___satfractusqqq - ___satfractusqhq - ___satfractusqsq - ___satfractusqdq - ___satfractusqtq - ___satfractusqha - ___satfractusqsa - ___satfractusqda - ___satfractusqta - ___satfractusquqq2 - ___satfractusquhq2 - ___satfractusqudq2 - ___satfractusqutq2 - ___satfractusquha - ___satfractusqusa - ___satfractusquda - ___satfractusquta - ___satfractudqqq - ___satfractudqhq - ___satfractudqsq - ___satfractudqdq - ___satfractudqtq - ___satfractudqha - ___satfractudqsa - ___satfractudqda - ___satfractudqta - ___satfractudquqq2 - ___satfractudquhq2 - ___satfractudqusq2 - ___satfractudqutq2 - ___satfractudquha - ___satfractudqusa - ___satfractudquda - ___satfractudquta - ___satfractutqqq - ___satfractutqhq - ___satfractutqsq - ___satfractutqdq - ___satfractutqtq - ___satfractutqha - ___satfractutqsa - ___satfractutqda - ___satfractutqta - ___satfractutquqq2 - ___satfractutquhq2 - ___satfractutqusq2 - ___satfractutqudq2 - ___satfractutquha - ___satfractutqusa - ___satfractutquda - ___satfractutquta - ___satfractuhaqq - ___satfractuhahq - ___satfractuhasq - ___satfractuhadq - ___satfractuhatq - ___satfractuhaha - ___satfractuhasa - ___satfractuhada - ___satfractuhata - ___satfractuhauqq - ___satfractuhauhq - ___satfractuhausq - ___satfractuhaudq - ___satfractuhautq - ___satfractuhausa2 - ___satfractuhauda2 - ___satfractuhauta2 - ___satfractusaqq - ___satfractusahq - ___satfractusasq - ___satfractusadq - ___satfractusatq - ___satfractusaha - ___satfractusasa - ___satfractusada - ___satfractusata - ___satfractusauqq - ___satfractusauhq - ___satfractusausq - ___satfractusaudq - ___satfractusautq - ___satfractusauha2 - ___satfractusauda2 - ___satfractusauta2 - ___satfractudaqq - ___satfractudahq - ___satfractudasq - ___satfractudadq - ___satfractudatq - ___satfractudaha - ___satfractudasa - ___satfractudada - ___satfractudata - ___satfractudauqq - ___satfractudauhq - ___satfractudausq - ___satfractudaudq - ___satfractudautq - ___satfractudauha2 - ___satfractudausa2 - ___satfractudauta2 - ___satfractutaqq - ___satfractutahq - ___satfractutasq - ___satfractutadq - ___satfractutatq - ___satfractutaha - ___satfractutasa - ___satfractutada - ___satfractutata - ___satfractutauqq - ___satfractutauhq - ___satfractutausq - ___satfractutaudq - ___satfractutautq - ___satfractutauha2 - ___satfractutausa2 - ___satfractutauda2 - ___satfractqiqq - ___satfractqihq - ___satfractqisq - ___satfractqidq - ___satfractqitq - ___satfractqiha - ___satfractqisa - ___satfractqida - ___satfractqita - ___satfractqiuqq - ___satfractqiuhq - ___satfractqiusq - ___satfractqiudq - ___satfractqiutq - ___satfractqiuha - ___satfractqiusa - ___satfractqiuda - ___satfractqiuta - ___satfracthiqq - ___satfracthihq - ___satfracthisq - ___satfracthidq - ___satfracthitq - ___satfracthiha - ___satfracthisa - ___satfracthida - ___satfracthita - ___satfracthiuqq - ___satfracthiuhq - ___satfracthiusq - ___satfracthiudq - ___satfracthiutq - ___satfracthiuha - ___satfracthiusa - ___satfracthiuda - ___satfracthiuta - ___satfractsiqq - ___satfractsihq - ___satfractsisq - ___satfractsidq - ___satfractsitq - ___satfractsiha - ___satfractsisa - ___satfractsida - ___satfractsita - ___satfractsiuqq - ___satfractsiuhq - ___satfractsiusq - ___satfractsiudq - ___satfractsiutq - ___satfractsiuha - ___satfractsiusa - ___satfractsiuda - ___satfractsiuta - ___satfractdiqq - ___satfractdihq - ___satfractdisq - ___satfractdidq - ___satfractditq - ___satfractdiha - ___satfractdisa - ___satfractdida - ___satfractdita - ___satfractdiuqq - ___satfractdiuhq - ___satfractdiusq - ___satfractdiudq - ___satfractdiutq - ___satfractdiuha - ___satfractdiusa - ___satfractdiuda - ___satfractdiuta - ___satfracttiqq - ___satfracttihq - ___satfracttisq - ___satfracttidq - ___satfracttitq - ___satfracttiha - ___satfracttisa - ___satfracttida - ___satfracttita - ___satfracttiuqq - ___satfracttiuhq - ___satfracttiusq - ___satfracttiudq - ___satfracttiutq - ___satfracttiuha - ___satfracttiusa - ___satfracttiuda - ___satfracttiuta - ___satfractsfqq - ___satfractsfhq - ___satfractsfsq - ___satfractsfdq - ___satfractsftq - ___satfractsfha - ___satfractsfsa - ___satfractsfda - ___satfractsfta - ___satfractsfuqq - ___satfractsfuhq - ___satfractsfusq - ___satfractsfudq - ___satfractsfutq - ___satfractsfuha - ___satfractsfusa - ___satfractsfuda - ___satfractsfuta - ___satfractdfqq - ___satfractdfhq - ___satfractdfsq - ___satfractdfdq - ___satfractdftq - ___satfractdfha - ___satfractdfsa - ___satfractdfda - ___satfractdfta - ___satfractdfuqq - ___satfractdfuhq - ___satfractdfusq - ___satfractdfudq - ___satfractdfutq - ___satfractdfuha - ___satfractdfusa - ___satfractdfuda - ___satfractdfuta - ___fractunsqqqi - ___fractunsqqhi - ___fractunsqqsi - ___fractunsqqdi - ___fractunsqqti - ___fractunshqqi - ___fractunshqhi - ___fractunshqsi - ___fractunshqdi - ___fractunshqti - ___fractunssqqi - ___fractunssqhi - ___fractunssqsi - ___fractunssqdi - ___fractunssqti - ___fractunsdqqi - ___fractunsdqhi - ___fractunsdqsi - ___fractunsdqdi - ___fractunsdqti - ___fractunstqqi - ___fractunstqhi - ___fractunstqsi - ___fractunstqdi - ___fractunstqti - ___fractunshaqi - ___fractunshahi - ___fractunshasi - ___fractunshadi - ___fractunshati - ___fractunssaqi - ___fractunssahi - ___fractunssasi - ___fractunssadi - ___fractunssati - ___fractunsdaqi - ___fractunsdahi - ___fractunsdasi - ___fractunsdadi - ___fractunsdati - ___fractunstaqi - ___fractunstahi - ___fractunstasi - ___fractunstadi - ___fractunstati - ___fractunsuqqqi - ___fractunsuqqhi - ___fractunsuqqsi - ___fractunsuqqdi - ___fractunsuqqti - ___fractunsuhqqi - ___fractunsuhqhi - ___fractunsuhqsi - ___fractunsuhqdi - ___fractunsuhqti - ___fractunsusqqi - ___fractunsusqhi - ___fractunsusqsi - ___fractunsusqdi - ___fractunsusqti - ___fractunsudqqi - ___fractunsudqhi - ___fractunsudqsi - ___fractunsudqdi - ___fractunsudqti - ___fractunsutqqi - ___fractunsutqhi - ___fractunsutqsi - ___fractunsutqdi - ___fractunsutqti - ___fractunsuhaqi - ___fractunsuhahi - ___fractunsuhasi - ___fractunsuhadi - ___fractunsuhati - ___fractunsusaqi - ___fractunsusahi - ___fractunsusasi - ___fractunsusadi - ___fractunsusati - ___fractunsudaqi - ___fractunsudahi - ___fractunsudasi - ___fractunsudadi - ___fractunsudati - ___fractunsutaqi - ___fractunsutahi - ___fractunsutasi - ___fractunsutadi - ___fractunsutati - ___fractunsqiqq - ___fractunsqihq - ___fractunsqisq - ___fractunsqidq - ___fractunsqitq - ___fractunsqiha - ___fractunsqisa - ___fractunsqida - ___fractunsqita - ___fractunsqiuqq - ___fractunsqiuhq - ___fractunsqiusq - ___fractunsqiudq - ___fractunsqiutq - ___fractunsqiuha - ___fractunsqiusa - ___fractunsqiuda - ___fractunsqiuta - ___fractunshiqq - ___fractunshihq - ___fractunshisq - ___fractunshidq - ___fractunshitq - ___fractunshiha - ___fractunshisa - ___fractunshida - ___fractunshita - ___fractunshiuqq - ___fractunshiuhq - ___fractunshiusq - ___fractunshiudq - ___fractunshiutq - ___fractunshiuha - ___fractunshiusa - ___fractunshiuda - ___fractunshiuta - ___fractunssiqq - ___fractunssihq - ___fractunssisq - ___fractunssidq - ___fractunssitq - ___fractunssiha - ___fractunssisa - ___fractunssida - ___fractunssita - ___fractunssiuqq - ___fractunssiuhq - ___fractunssiusq - ___fractunssiudq - ___fractunssiutq - ___fractunssiuha - ___fractunssiusa - ___fractunssiuda - ___fractunssiuta - ___fractunsdiqq - ___fractunsdihq - ___fractunsdisq - ___fractunsdidq - ___fractunsditq - ___fractunsdiha - ___fractunsdisa - ___fractunsdida - ___fractunsdita - ___fractunsdiuqq - ___fractunsdiuhq - ___fractunsdiusq - ___fractunsdiudq - ___fractunsdiutq - ___fractunsdiuha - ___fractunsdiusa - ___fractunsdiuda - ___fractunsdiuta - ___fractunstiqq - ___fractunstihq - ___fractunstisq - ___fractunstidq - ___fractunstitq - ___fractunstiha - ___fractunstisa - ___fractunstida - ___fractunstita - ___fractunstiuqq - ___fractunstiuhq - ___fractunstiusq - ___fractunstiudq - ___fractunstiutq - ___fractunstiuha - ___fractunstiusa - ___fractunstiuda - ___fractunstiuta - ___satfractunsqiqq - ___satfractunsqihq - ___satfractunsqisq - ___satfractunsqidq - ___satfractunsqitq - ___satfractunsqiha - ___satfractunsqisa - ___satfractunsqida - ___satfractunsqita - ___satfractunsqiuqq - ___satfractunsqiuhq - ___satfractunsqiusq - ___satfractunsqiudq - ___satfractunsqiutq - ___satfractunsqiuha - ___satfractunsqiusa - ___satfractunsqiuda - ___satfractunsqiuta - ___satfractunshiqq - ___satfractunshihq - ___satfractunshisq - ___satfractunshidq - ___satfractunshitq - ___satfractunshiha - ___satfractunshisa - ___satfractunshida - ___satfractunshita - ___satfractunshiuqq - ___satfractunshiuhq - ___satfractunshiusq - ___satfractunshiudq - ___satfractunshiutq - ___satfractunshiuha - ___satfractunshiusa - ___satfractunshiuda - ___satfractunshiuta - ___satfractunssiqq - ___satfractunssihq - ___satfractunssisq - ___satfractunssidq - ___satfractunssitq - ___satfractunssiha - ___satfractunssisa - ___satfractunssida - ___satfractunssita - ___satfractunssiuqq - ___satfractunssiuhq - ___satfractunssiusq - ___satfractunssiudq - ___satfractunssiutq - ___satfractunssiuha - ___satfractunssiusa - ___satfractunssiuda - ___satfractunssiuta - ___satfractunsdiqq - ___satfractunsdihq - ___satfractunsdisq - ___satfractunsdidq - ___satfractunsditq - ___satfractunsdiha - ___satfractunsdisa - ___satfractunsdida - ___satfractunsdita - ___satfractunsdiuqq - ___satfractunsdiuhq - ___satfractunsdiusq - ___satfractunsdiudq - ___satfractunsdiutq - ___satfractunsdiuha - ___satfractunsdiusa - ___satfractunsdiuda - ___satfractunsdiuta - ___satfractunstiqq - ___satfractunstihq - ___satfractunstisq - ___satfractunstidq - ___satfractunstitq - ___satfractunstiha - ___satfractunstisa - ___satfractunstida - ___satfractunstita - ___satfractunstiuqq - ___satfractunstiuhq - ___satfractunstiusq - ___satfractunstiudq - ___satfractunstiutq - ___satfractunstiuha - ___satfractunstiusa - ___satfractunstiuda - ___satfractunstiuta -} - -%inherit GCC_4.4.0 GCC_4.3.0 -GCC_4.4.0 { - ___sync_fetch_and_add_1 - ___sync_fetch_and_sub_1 - ___sync_fetch_and_or_1 - ___sync_fetch_and_and_1 - ___sync_fetch_and_xor_1 - ___sync_fetch_and_nand_1 - ___sync_add_and_fetch_1 - ___sync_sub_and_fetch_1 - ___sync_or_and_fetch_1 - ___sync_and_and_fetch_1 - ___sync_xor_and_fetch_1 - ___sync_nand_and_fetch_1 - ___sync_bool_compare_and_swap_1 - ___sync_val_compare_and_swap_1 - ___sync_lock_test_and_set_1 - - ___sync_fetch_and_add_2 - ___sync_fetch_and_sub_2 - ___sync_fetch_and_or_2 - ___sync_fetch_and_and_2 - ___sync_fetch_and_xor_2 - ___sync_fetch_and_nand_2 - ___sync_add_and_fetch_2 - ___sync_sub_and_fetch_2 - ___sync_or_and_fetch_2 - ___sync_and_and_fetch_2 - ___sync_xor_and_fetch_2 - ___sync_nand_and_fetch_2 - ___sync_bool_compare_and_swap_2 - ___sync_val_compare_and_swap_2 - ___sync_lock_test_and_set_2 - - ___sync_fetch_and_add_4 - ___sync_fetch_and_sub_4 - ___sync_fetch_and_or_4 - ___sync_fetch_and_and_4 - ___sync_fetch_and_xor_4 - ___sync_fetch_and_nand_4 - ___sync_add_and_fetch_4 - ___sync_sub_and_fetch_4 - ___sync_or_and_fetch_4 - ___sync_and_and_fetch_4 - ___sync_xor_and_fetch_4 - ___sync_nand_and_fetch_4 - ___sync_bool_compare_and_swap_4 - ___sync_val_compare_and_swap_4 - ___sync_lock_test_and_set_4 - - ___sync_fetch_and_add_8 - ___sync_fetch_and_sub_8 - ___sync_fetch_and_or_8 - ___sync_fetch_and_and_8 - ___sync_fetch_and_xor_8 - ___sync_fetch_and_nand_8 - ___sync_add_and_fetch_8 - ___sync_sub_and_fetch_8 - ___sync_or_and_fetch_8 - ___sync_and_and_fetch_8 - ___sync_xor_and_fetch_8 - ___sync_nand_and_fetch_8 - ___sync_bool_compare_and_swap_8 - ___sync_val_compare_and_swap_8 - ___sync_lock_test_and_set_8 - - ___sync_fetch_and_add_16 - ___sync_fetch_and_sub_16 - ___sync_fetch_and_or_16 - ___sync_fetch_and_and_16 - ___sync_fetch_and_xor_16 - ___sync_fetch_and_nand_16 - ___sync_add_and_fetch_16 - ___sync_sub_and_fetch_16 - ___sync_or_and_fetch_16 - ___sync_and_and_fetch_16 - ___sync_xor_and_fetch_16 - ___sync_nand_and_fetch_16 - ___sync_bool_compare_and_swap_16 - ___sync_val_compare_and_swap_16 - ___sync_lock_test_and_set_16 - - ___sync_synchronize -} - -%inherit GCC_4.5.0 GCC_4.4.0 -GCC_4.5.0 { - ___unordxf2 - ___unordtf2 + __smulsi3_highpart + __umulsi3_highpart } diff --git a/libgcc/config/bfin/t-linux b/libgcc/config/bfin/t-linux index 1c42e48..8898157 100644 --- a/libgcc/config/bfin/t-linux +++ b/libgcc/config/bfin/t-linux @@ -1 +1,2 @@ -SHLIB_MAPFILES = $(srcdir)/config/bfin/libgcc-glibc.ver +SHLIB_MAPFILES += $(srcdir)/config/bfin/libgcc-glibc.ver +SHLIB_MKMAP_OPTS = -v skip_underscore=1 -- 2.7.4
shibajee/buildroot
package/gcc/6.1.0/893-libgcc-config-bfin-use-the-generic-linker-version-in.patch
patch
mit
37,029
From 9d9f97ca5d1ceba66677bf406c9b31027dc1f22e Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb <wbx@openadk.org> Date: Fri, 19 Aug 2016 13:54:46 +0200 Subject: [PATCH] libgcc: fix DWARF compilation with FDPIC targets The build of unwind-dw2-fde-dip.c currently fails for FDPIC targets with the following error: libgcc/unwind-dw2-fde-dip.c:167:31: error: storage size of 'load_base' isn't known struct elf32_fdpic_loadaddr load_base; This patch addresses that by defining load_base with the appropriate type on FDPIC targets. It has been tested on FRV and Blackfin. Fixes PR gcc/68468. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- libgcc/ChangeLog | 5 +++++ libgcc/unwind-dw2-fde-dip.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 36c0194..2e78d20 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2016-08-19 Waldemar Brodkorb <wbx@openadk.org> + + PR gcc/68468 + * libgcc/unwind-dw2-fde-dip.c: fix build on FDPIC targets. + 2016-08-19 Thomas Petazzoni <thomas.petazzoni@free-electrons.com> PR gcc/74748 diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c index f7a1c3f..801bce8 100644 --- a/libgcc/unwind-dw2-fde-dip.c +++ b/libgcc/unwind-dw2-fde-dip.c @@ -124,7 +124,11 @@ static struct frame_hdr_cache_element { _Unwind_Ptr pc_low; _Unwind_Ptr pc_high; +#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__ + struct elf32_fdpic_loadaddr load_base; +#else _Unwind_Ptr load_base; +#endif const ElfW(Phdr) *p_eh_frame_hdr; const ElfW(Phdr) *p_dynamic; struct frame_hdr_cache_element *link; @@ -163,7 +167,7 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr) struct unw_eh_callback_data *data = (struct unw_eh_callback_data *) ptr; const ElfW(Phdr) *phdr, *p_eh_frame_hdr, *p_dynamic; long n, match; -#ifdef __FRV_FDPIC__ +#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__ struct elf32_fdpic_loadaddr load_base; #else _Unwind_Ptr load_base; @@ -347,7 +351,7 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr) break; } } -# elif defined __FRV_FDPIC__ && defined __linux__ +# elif (defined __FRV_FDPIC__ || defined __BFIN_FDPIC__) && defined __linux__ data->dbase = load_base.got_value; # else # error What is DW_EH_PE_datarel base on this platform? -- 2.7.4
shibajee/buildroot
package/gcc/6.1.0/894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch
patch
mit
2,501
Enable POSIX threads for uClinux targets Reported upstream: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71721 Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur gcc-6.1.0.orig/gcc/config.gcc gcc-6.1.0/gcc/config.gcc --- gcc-6.1.0.orig/gcc/config.gcc 2016-04-11 12:14:59.000000000 +0200 +++ gcc-6.1.0/gcc/config.gcc 2016-07-02 20:04:25.732169982 +0200 @@ -833,6 +833,9 @@ *-*-uclinux*) extra_options="$extra_options gnu-user.opt" use_gcc_stdint=wrap + case ${enable_threads} in + "" | yes | posix) thread_file='posix' ;; + esac tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC" ;; *-*-rdos*)
shibajee/buildroot
package/gcc/6.1.0/940-uclinux-enable-threads.patch
patch
mit
635
comment "GCC Options" config BR2_GCC_NEEDS_MPC bool config BR2_GCC_SUPPORTS_GRAPHITE bool choice prompt "GCC compiler Version" default BR2_GCC_VERSION_4_8_ARC if BR2_arc default BR2_GCC_VERSION_4_9_X help Select the version of gcc you wish to use. config BR2_GCC_VERSION_4_7_X bool "gcc 4.7.x" depends on BR2_DEPRECATED_SINCE_2016_05 # Broken or unsupported architectures depends on !BR2_microblaze && !BR2_aarch64 && !BR2_arc \ && !BR2_powerpc64le && !BR2_nios2 && !BR2_bfin # Broken or unsupported ARM cores depends on !BR2_cortex_a12 && !BR2_pj4 && !BR2_cortex_a17 # Broken or unsupported PPC cores depends on !BR2_powerpc_e5500 && !BR2_powerpc_e6500 && \ !BR2_powerpc_power8 # SPARC -mcpu=leon3 appeared in gcc 4.8.x depends on !BR2_sparc_leon3 # Broken or unsupported x86 cores depends on !BR2_x86_jaguar && !BR2_x86_steamroller # Unsupported for MIPS R6 depends on !BR2_mips_32r6 && !BR2_mips_64r6 select BR2_GCC_NEEDS_MPC select BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 config BR2_GCC_VERSION_4_8_X bool "gcc 4.8.x" # Broken or unsupported architectures depends on !BR2_microblaze && !BR2_arc \ && !BR2_powerpc64le && !BR2_nios2 && !BR2_bfin # Broken or unsupported ARM cores depends on !BR2_cortex_a12 && !BR2_cortex_a17 # Broken or unsupported PPC cores depends on !BR2_powerpc_power8 # gcc-4.8.x + binutils-2.25 is broken for MIPS depends on !((BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el) && BR2_BINUTILS_VERSION_2_25_X) # Unsupported for MIPS R6 depends on !BR2_mips_32r6 && !BR2_mips_64r6 select BR2_GCC_NEEDS_MPC select BR2_GCC_SUPPORTS_GRAPHITE select BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 config BR2_GCC_VERSION_4_8_ARC bool "gcc 4.8-arc" # Only supported architecture depends on BR2_arc select BR2_GCC_NEEDS_MPC select BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 config BR2_GCC_VERSION_4_9_X bool "gcc 4.9.x" # Broken or unsupported architectures depends on !BR2_arc && !BR2_bfin # Broken or unsupported ARM cores depends on !BR2_cortex_a17 # Unsupported for MIPS R6 depends on !BR2_mips_32r6 && !BR2_mips_64r6 # PR60102 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60102 select BR2_GCC_NEEDS_MPC select BR2_GCC_SUPPORTS_GRAPHITE select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 config BR2_GCC_VERSION_5_X bool "gcc 5.x" # Broken or unsupported architectures depends on !BR2_arc && !BR2_bfin select BR2_GCC_NEEDS_MPC select BR2_GCC_SUPPORTS_GRAPHITE select BR2_TOOLCHAIN_GCC_AT_LEAST_5 config BR2_GCC_VERSION_6_X bool "gcc 6.x" # Broken or unsupported architectures depends on !BR2_arc select BR2_GCC_NEEDS_MPC select BR2_GCC_SUPPORTS_GRAPHITE select BR2_TOOLCHAIN_GCC_AT_LEAST_6 endchoice # Indicates if GCC for architecture supports --with-{arch,cpu,..} to # set default CFLAGS, otherwise values will be used by toolchain # wrapper. config BR2_GCC_ARCH_HAS_CONFIGURABLE_DEFAULTS bool default y if !BR2_bfin config BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE bool default y config BR2_GCC_VERSION string default "4.7.4" if BR2_GCC_VERSION_4_7_X default "4.8.5" if BR2_GCC_VERSION_4_8_X default "4.9.4" if BR2_GCC_VERSION_4_9_X default "5.4.0" if BR2_GCC_VERSION_5_X default "6.1.0" if BR2_GCC_VERSION_6_X default "arc-2016.09-eng010" if BR2_GCC_VERSION_4_8_ARC config BR2_EXTRA_GCC_CONFIG_OPTIONS string "Additional gcc options" default "" help Any additional gcc configure options you may want to include. Those options are applied for all of the gcc initial, gcc intermediate and gcc final passes. config BR2_TOOLCHAIN_BUILDROOT_CXX bool "Enable C++ support" select BR2_INSTALL_LIBSTDCPP help Enable this option if you want your toolchain to support the C++ language and you want C++ libraries to be installed on your target system. comment "Fortran support needs a toolchain w/ wchar" depends on BR2_TOOLCHAIN_HAS_LIBQUADMATH depends on !BR2_USE_WCHAR # libquadmath config BR2_TOOLCHAIN_BUILDROOT_FORTRAN bool "Enable Fortran support" # on architecture building libquadmath, wchar is required depends on !BR2_TOOLCHAIN_HAS_LIBQUADMATH || \ (BR2_TOOLCHAIN_HAS_LIBQUADMATH && BR2_USE_WCHAR) select BR2_TOOLCHAIN_HAS_FORTRAN help Enable this option if you want your toolchain to support the Fortran language and you want Fortran libraries to be installed on your target system. config BR2_GCC_ENABLE_TLS bool "Enable compiler tls support" if BR2_TOOLCHAIN_BUILDROOT_UCLIBC default y depends on BR2_PTHREADS_NATIVE || BR2_TOOLCHAIN_BUILDROOT_GLIBC help Enable the compiler to generate code for accessing thread local storage variables config BR2_GCC_ENABLE_LTO bool "Enable compiler link-time-optimization support" select BR2_BINUTILS_ENABLE_LTO help This option enables link-time optimization (LTO) support in gcc. config BR2_GCC_ENABLE_OPENMP bool "Enable compiler OpenMP support" depends on !BR2_PTHREADS_NONE && !BR2_arc && !BR2_microblaze help Enable OpenMP support for the compiler config BR2_GCC_ENABLE_LIBMUDFLAP bool "Enable libmudflap support" # There are architectures, or specific configurations for # which mudflap is not supported. depends on !BR2_ARM_INSTRUCTIONS_THUMB && !BR2_powerpc_SPE depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 help libmudflap is a gcc library used for the mudflap pointer debugging functionality. It is only needed if you intend to use the -fmudflap gcc flag. See http://gcc.gnu.org/wiki/Mudflap_Pointer_Debugging and the help of the gcc -fmudflap option for more details. If you're unsure, leave this option disabled. config BR2_GCC_ENABLE_GRAPHITE bool "Enable graphite support" depends on BR2_GCC_SUPPORTS_GRAPHITE help This option enables the graphite optimizations in the compiler.
shibajee/buildroot
package/gcc/Config.in.host
host
mit
5,793
Index: b/boehm-gc/include/gc.h =================================================================== --- a/boehm-gc/include/gc.h +++ b/boehm-gc/include/gc.h @@ -503,7 +503,7 @@ #if defined(__linux__) || defined(__GLIBC__) # include <features.h> # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \ - && !defined(__ia64__) + && !defined(__ia64__) && !defined(__UCLIBC__) # ifndef GC_HAVE_BUILTIN_BACKTRACE # define GC_HAVE_BUILTIN_BACKTRACE # endif
shibajee/buildroot
package/gcc/arc-2016.09-eng010/301-missing-execinfo_h.patch
patch
mit
480
[PATCH] cilk: fix build without wchar When building against uClibc with wchar support disabled, WCHAR_MIN and WCHAR_MAX are not defined leading to compilation errors. Fix it by only including the wchar code if available. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> --- libcilkrts/include/cilk/reducer_min_max.h | 8 ++++++++ 1 file changed, 8 insertions(+) Index: b/libcilkrts/include/cilk/reducer_min_max.h =================================================================== --- a/libcilkrts/include/cilk/reducer_min_max.h +++ b/libcilkrts/include/cilk/reducer_min_max.h @@ -3154,7 +3154,9 @@ CILK_C_REDUCER_MAX_INSTANCE(char, char, CHAR_MIN) CILK_C_REDUCER_MAX_INSTANCE(unsigned char, uchar, 0) CILK_C_REDUCER_MAX_INSTANCE(signed char, schar, SCHAR_MIN) +#ifdef WCHAR_MIN CILK_C_REDUCER_MAX_INSTANCE(wchar_t, wchar_t, WCHAR_MIN) +#endif CILK_C_REDUCER_MAX_INSTANCE(short, short, SHRT_MIN) CILK_C_REDUCER_MAX_INSTANCE(unsigned short, ushort, 0) CILK_C_REDUCER_MAX_INSTANCE(int, int, INT_MIN) @@ -3306,7 +3308,9 @@ CILK_C_REDUCER_MAX_INDEX_INSTANCE(char, char, CHAR_MIN) CILK_C_REDUCER_MAX_INDEX_INSTANCE(unsigned char, uchar, 0) CILK_C_REDUCER_MAX_INDEX_INSTANCE(signed char, schar, SCHAR_MIN) +#ifdef WCHAR_MIN CILK_C_REDUCER_MAX_INDEX_INSTANCE(wchar_t, wchar_t, WCHAR_MIN) +#endif CILK_C_REDUCER_MAX_INDEX_INSTANCE(short, short, SHRT_MIN) CILK_C_REDUCER_MAX_INDEX_INSTANCE(unsigned short, ushort, 0) CILK_C_REDUCER_MAX_INDEX_INSTANCE(int, int, INT_MIN) @@ -3432,7 +3436,9 @@ CILK_C_REDUCER_MIN_INSTANCE(char, char, CHAR_MAX) CILK_C_REDUCER_MIN_INSTANCE(unsigned char, uchar, CHAR_MAX) CILK_C_REDUCER_MIN_INSTANCE(signed char, schar, SCHAR_MAX) +#ifdef WCHAR_MAX CILK_C_REDUCER_MIN_INSTANCE(wchar_t, wchar_t, WCHAR_MAX) +#endif CILK_C_REDUCER_MIN_INSTANCE(short, short, SHRT_MAX) CILK_C_REDUCER_MIN_INSTANCE(unsigned short, ushort, USHRT_MAX) CILK_C_REDUCER_MIN_INSTANCE(int, int, INT_MAX) @@ -3584,7 +3590,9 @@ CILK_C_REDUCER_MIN_INDEX_INSTANCE(char, char, CHAR_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(unsigned char, uchar, CHAR_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(signed char, schar, SCHAR_MAX) +#ifdef WCHAR_MAX CILK_C_REDUCER_MIN_INDEX_INSTANCE(wchar_t, wchar_t, WCHAR_MAX) +#endif CILK_C_REDUCER_MIN_INDEX_INSTANCE(short, short, SHRT_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(unsigned short, ushort, USHRT_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(int, int, INT_MAX)
shibajee/buildroot
package/gcc/arc-2016.09-eng010/860-cilk-wchar.patch
patch
mit
2,831
Enable POSIX threads for uClinux targets Reported upstream: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71721 Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur gcc-6.1.0.orig/gcc/config.gcc gcc-6.1.0/gcc/config.gcc --- gcc-6.1.0.orig/gcc/config.gcc 2016-04-11 12:14:59.000000000 +0200 +++ gcc-6.1.0/gcc/config.gcc 2016-07-02 20:04:25.732169982 +0200 @@ -833,6 +833,9 @@ *-*-uclinux*) extra_options="$extra_options gnu-user.opt" use_gcc_stdint=wrap + case ${enable_threads} in + "" | yes | posix) thread_file='posix' ;; + esac tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC" ;; *-*-rdos*)
shibajee/buildroot
package/gcc/arc-2016.09-eng010/940-uclinux-enable-threads.patch
patch
mit
635
################################################################################ # # gcc-final # ################################################################################ GCC_FINAL_VERSION = $(GCC_VERSION) GCC_FINAL_SITE = $(GCC_SITE) GCC_FINAL_SOURCE = $(GCC_SOURCE) HOST_GCC_FINAL_DEPENDENCIES = \ $(HOST_GCC_COMMON_DEPENDENCIES) \ $(BR_LIBC) HOST_GCC_FINAL_EXCLUDES = $(HOST_GCC_EXCLUDES) HOST_GCC_FINAL_POST_EXTRACT_HOOKS += HOST_GCC_FAKE_TESTSUITE ifneq ($(call qstrip, $(BR2_XTENSA_CORE_NAME)),) HOST_GCC_FINAL_POST_EXTRACT_HOOKS += HOST_GCC_XTENSA_OVERLAY_EXTRACT endif HOST_GCC_FINAL_POST_PATCH_HOOKS += HOST_GCC_APPLY_PATCHES # gcc doesn't support in-tree build, so we create a 'build' # subdirectory in the gcc sources, and build from there. HOST_GCC_FINAL_SUBDIR = build HOST_GCC_FINAL_PRE_CONFIGURE_HOOKS += HOST_GCC_CONFIGURE_SYMLINK # We want to always build the static variants of all the gcc libraries, # of which libstdc++, libgomp, libmudflap... # To do so, we can not just pass --enable-static to override the generic # --disable-static flag, otherwise gcc fails to build some of those # libraries, see; # http://lists.busybox.net/pipermail/buildroot/2013-October/080412.html # # So we must completely override the generic commands and provide our own. # define HOST_GCC_FINAL_CONFIGURE_CMDS (cd $(HOST_GCC_FINAL_SRCDIR) && rm -rf config.cache; \ $(HOST_CONFIGURE_OPTS) \ CFLAGS="$(HOST_CFLAGS)" \ LDFLAGS="$(HOST_LDFLAGS)" \ $(HOST_GCC_FINAL_CONF_ENV) \ ./configure \ --prefix="$(HOST_DIR)/usr" \ --sysconfdir="$(HOST_DIR)/etc" \ --enable-static \ $(QUIET) $(HOST_GCC_FINAL_CONF_OPTS) \ ) endef # Languages supported by the cross-compiler GCC_FINAL_CROSS_LANGUAGES-y = c GCC_FINAL_CROSS_LANGUAGES-$(BR2_INSTALL_LIBSTDCPP) += c++ GCC_FINAL_CROSS_LANGUAGES-$(BR2_TOOLCHAIN_BUILDROOT_FORTRAN) += fortran GCC_FINAL_CROSS_LANGUAGES = $(subst $(space),$(comma),$(GCC_FINAL_CROSS_LANGUAGES-y)) HOST_GCC_FINAL_CONF_OPTS = \ $(HOST_GCC_COMMON_CONF_OPTS) \ --enable-languages=$(GCC_FINAL_CROSS_LANGUAGES) \ --with-build-time-tools=$(HOST_DIR)/usr/$(GNU_TARGET_NAME)/bin HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib* # The kernel wants to use the -m4-nofpu option to make sure that it # doesn't use floating point operations. ifeq ($(BR2_sh4)$(BR2_sh4eb),y) HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4,m4-nofpu" HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib/!m4* endif ifeq ($(BR2_sh4a)$(BR2_sh4aeb),y) HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4a,m4a-nofpu" HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib/!m4* endif ifeq ($(BR2_bfin),y) HOST_GCC_FINAL_CONF_OPTS += --disable-symvers endif # Disable shared libs like libstdc++ if we do static since it confuses linking ifeq ($(BR2_STATIC_LIBS),y) HOST_GCC_FINAL_CONF_OPTS += --disable-shared else HOST_GCC_FINAL_CONF_OPTS += --enable-shared endif ifeq ($(BR2_GCC_ENABLE_OPENMP),y) HOST_GCC_FINAL_CONF_OPTS += --enable-libgomp else HOST_GCC_FINAL_CONF_OPTS += --disable-libgomp endif # End with user-provided options, so that they can override previously # defined options. HOST_GCC_FINAL_CONF_OPTS += \ $(call qstrip,$(BR2_EXTRA_GCC_CONFIG_OPTIONS)) HOST_GCC_FINAL_CONF_ENV = \ $(HOST_GCC_COMMON_CONF_ENV) HOST_GCC_FINAL_MAKE_OPTS += $(HOST_GCC_COMMON_MAKE_OPTS) # Make sure we have 'cc' define HOST_GCC_FINAL_CREATE_CC_SYMLINKS if [ ! -e $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc ]; then \ ln -f $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-gcc \ $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc; \ fi endef HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_CREATE_CC_SYMLINKS HOST_GCC_FINAL_TOOLCHAIN_WRAPPER_ARGS += $(HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS) HOST_GCC_FINAL_POST_BUILD_HOOKS += TOOLCHAIN_BUILD_WRAPPER # Note: this must be done after CREATE_CC_SYMLINKS, otherwise the # -cc symlink to the wrapper is not created. HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_INSTALL_WRAPPER_AND_SIMPLE_SYMLINKS # In gcc 4.7.x, the ARM EABIhf library loader path for glibc was not # correct, so we create a symbolic link to make things work # properly. glibc installs the library loader as ld-linux-armhf.so.3, # but gcc creates binaries that reference ld-linux.so.3. ifeq ($(BR2_arm)$(BR2_ARM_EABIHF)$(BR2_GCC_VERSION_4_7_X)$(BR2_TOOLCHAIN_USES_GLIBC),yyyy) define HOST_GCC_FINAL_LD_LINUX_LINK ln -sf ld-linux-armhf.so.3 $(TARGET_DIR)/lib/ld-linux.so.3 ln -sf ld-linux-armhf.so.3 $(STAGING_DIR)/lib/ld-linux.so.3 endef HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_LD_LINUX_LINK endif # coldfire is not working without removing these object files from libgcc.a ifeq ($(BR2_m68k_cf),y) define HOST_GCC_FINAL_M68K_LIBGCC_FIXUP find $(STAGING_DIR) -name libgcc.a -print | \ while read t; do $(GNU_TARGET_NAME)-ar dv "$t" _ctors.o; done endef HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_M68K_LIBGCC_FIXUP endif # Cannot use the HOST_GCC_FINAL_USR_LIBS mechanism below, because we want # libgcc_s to be installed in /lib and not /usr/lib. define HOST_GCC_FINAL_INSTALL_LIBGCC -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/libgcc_s* \ $(STAGING_DIR)/lib/ -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/libgcc_s* \ $(TARGET_DIR)/lib/ endef HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_LIBGCC define HOST_GCC_FINAL_INSTALL_LIBATOMIC -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/libatomic* \ $(STAGING_DIR)/lib/ -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/libatomic* \ $(TARGET_DIR)/lib/ endef HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_LIBATOMIC # Handle the installation of libraries in /usr/lib HOST_GCC_FINAL_USR_LIBS = ifeq ($(BR2_INSTALL_LIBSTDCPP),y) HOST_GCC_FINAL_USR_LIBS += libstdc++ endif ifeq ($(BR2_TOOLCHAIN_BUILDROOT_FORTRAN),y) HOST_GCC_FINAL_USR_LIBS += libgfortran # fortran needs quadmath on x86 and x86_64 ifeq ($(BR2_TOOLCHAIN_HAS_LIBQUADMATH),y) HOST_GCC_FINAL_USR_LIBS += libquadmath endif endif ifeq ($(BR2_GCC_ENABLE_OPENMP),y) HOST_GCC_FINAL_USR_LIBS += libgomp endif ifeq ($(BR2_GCC_ENABLE_LIBMUDFLAP),y) ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) HOST_GCC_FINAL_USR_LIBS += libmudflapth else HOST_GCC_FINAL_USR_LIBS += libmudflap endif endif ifneq ($(HOST_GCC_FINAL_USR_LIBS),) define HOST_GCC_FINAL_INSTALL_STATIC_LIBS for i in $(HOST_GCC_FINAL_USR_LIBS) ; do \ cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$${i}.a \ $(STAGING_DIR)/usr/lib/ ; \ done endef ifeq ($(BR2_STATIC_LIBS),) define HOST_GCC_FINAL_INSTALL_SHARED_LIBS for i in $(HOST_GCC_FINAL_USR_LIBS) ; do \ cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$${i}.so* \ $(STAGING_DIR)/usr/lib/ ; \ cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$${i}.so* \ $(TARGET_DIR)/usr/lib/ ; \ done endef endif define HOST_GCC_FINAL_INSTALL_USR_LIBS mkdir -p $(TARGET_DIR)/usr/lib $(HOST_GCC_FINAL_INSTALL_STATIC_LIBS) $(HOST_GCC_FINAL_INSTALL_SHARED_LIBS) endef HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_USR_LIBS endif $(eval $(host-autotools-package))
shibajee/buildroot
package/gcc/gcc-final/gcc-final.mk
mk
mit
6,983
################################################################################ # # gcc-initial # ################################################################################ GCC_INITIAL_VERSION = $(GCC_VERSION) GCC_INITIAL_SITE = $(GCC_SITE) GCC_INITIAL_SOURCE = $(GCC_SOURCE) HOST_GCC_INITIAL_DEPENDENCIES = $(HOST_GCC_COMMON_DEPENDENCIES) HOST_GCC_INITIAL_EXCLUDES = $(HOST_GCC_EXCLUDES) HOST_GCC_INITIAL_POST_EXTRACT_HOOKS += HOST_GCC_FAKE_TESTSUITE ifneq ($(call qstrip, $(BR2_XTENSA_CORE_NAME)),) HOST_GCC_INITIAL_POST_EXTRACT_HOOKS += HOST_GCC_XTENSA_OVERLAY_EXTRACT endif HOST_GCC_INITIAL_POST_PATCH_HOOKS += HOST_GCC_APPLY_PATCHES # gcc doesn't support in-tree build, so we create a 'build' # subdirectory in the gcc sources, and build from there. HOST_GCC_INITIAL_SUBDIR = build HOST_GCC_INITIAL_PRE_CONFIGURE_HOOKS += HOST_GCC_CONFIGURE_SYMLINK # gcc on ARC has a bug: in its libgcc, even when no C library is # available (--with-newlib is passed, and therefore inhibit_libc is # defined), it tries to use the C library for the libgmon # library. Since it's not needed in gcc-initial, we disabled it here. ifeq ($(BR2_GCC_VERSION_4_8_ARC),y) define HOST_GCC_INITIAL_DISABLE_LIBGMON $(SED) 's/crtbeginS.o libgmon.a crtg.o/crtbeginS.o crtg.o/' \ $(@D)/libgcc/config.host endef HOST_GCC_INITIAL_POST_PATCH_HOOKS += HOST_GCC_INITIAL_DISABLE_LIBGMON HOST_GCC_INITIAL_POST_RSYNC_HOOKS += HOST_GCC_INITIAL_DISABLE_LIBGMON endif HOST_GCC_INITIAL_CONF_OPTS = \ $(HOST_GCC_COMMON_CONF_OPTS) \ --enable-languages=c \ --disable-shared \ --without-headers \ --disable-threads \ --with-newlib \ --disable-largefile \ --disable-nls \ $(call qstrip,$(BR2_EXTRA_GCC_CONFIG_OPTIONS)) HOST_GCC_INITIAL_CONF_ENV = \ $(HOST_GCC_COMMON_CONF_ENV) HOST_GCC_INITIAL_MAKE_OPTS = $(HOST_GCC_COMMON_MAKE_OPTS) all-gcc HOST_GCC_INITIAL_INSTALL_OPTS = install-gcc ifeq ($(BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE),y) HOST_GCC_INITIAL_MAKE_OPTS += all-target-libgcc HOST_GCC_INITIAL_INSTALL_OPTS += install-target-libgcc endif HOST_GCC_INITIAL_TOOLCHAIN_WRAPPER_ARGS += $(HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS) HOST_GCC_INITIAL_POST_BUILD_HOOKS += TOOLCHAIN_BUILD_WRAPPER HOST_GCC_INITIAL_POST_INSTALL_HOOKS += HOST_GCC_INSTALL_WRAPPER_AND_SIMPLE_SYMLINKS $(eval $(host-autotools-package))
shibajee/buildroot
package/gcc/gcc-initial/gcc-initial.mk
mk
mit
2,296
# From ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.5.4/sha512.sum sha512 78696b287d46aacd6f150920da376ea32f58ad9f0dafd2d3b7fa6dbdd8dd7afe659108d1dfaa5807617fc5248719f50b39c37ade0173ea5b9fec2091f4656115 gcc-4.5.4.tar.bz2 # From ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.7.4/sha512.sum sha512 dfcb737073191e628231031a3571ec77ee760a59377630f4a6e4fdfa66f9ddad39fde47e3f0f227eb43cdf90e0d34cde5abdc9ac892c1e111a911062a66c9189 gcc-4.7.4.tar.bz2 # From ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.8.5/sha512.sum sha512 47fdfeca0c0a624cdec9c4ae47137d056c918d5c386d4b96985bb3c8172aba377cb66cbcc30e80832fd244a7d98f562c20198056915c70cfef0977545073a8ea gcc-4.8.5.tar.bz2 # From ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.9.4/sha512.sum sha512 93abb78e16277454f41a8e9810f41f66c0fdffdc539a762ff6b67d3037f78db971378683fd2ebf707d1d51c059fad2161fe42d110c330027f40214b7db0f3efe gcc-4.9.4.tar.bz2 # From ftp://gcc.gnu.org/pub/gcc/releases/gcc-5.4.0/sha512.sum sha512 2941cc950c8f2409a314df497631f9b0266211aa74746c1839c46e04f1c7c299afe2528d1ef16ea39def408a644ba48f97519ec7a7dd37d260c3e9423514265b gcc-5.4.0.tar.bz2 # From ftp://gcc.gnu.org/pub/gcc/releases/gcc-6.1.0/sha512.sum sha512 eeed3e2018b8c012aabce419e8d718fde701e5c3c179b4486c61ba46e5736eecc8fccdd18b01fcd973a42c6ad3116dbbe2ee247fe3757d622d373f93ebaf8d2e gcc-6.1.0.tar.bz2 # Locally calculated (fetched from Github) sha512 a788737022c178a1e7704e4ecd3438937f2239bf27fd487db2b00e4bb5c6604535842e4d6798f120488bdbf0b226fa9c94f4b8aede4ce9d20b0add6bcec82927 gcc-arc-2016.09-eng010.tar.gz
shibajee/buildroot
package/gcc/gcc.hash
hash
mit
1,526
################################################################################ # # Common variables for the gcc-initial and gcc-final packages. # ################################################################################ # # Version, site and source # GCC_VERSION = $(call qstrip,$(BR2_GCC_VERSION)) ifeq ($(BR2_arc),y) GCC_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,gcc,$(GCC_VERSION)) GCC_SOURCE = gcc-$(GCC_VERSION).tar.gz else GCC_SITE = $(BR2_GNU_MIRROR:/=)/gcc/gcc-$(GCC_VERSION) endif GCC_SOURCE ?= gcc-$(GCC_VERSION).tar.bz2 # # Xtensa special hook # HOST_GCC_XTENSA_OVERLAY_TAR = $(BR2_XTENSA_OVERLAY_DIR)/xtensa_$(call qstrip,$(BR2_XTENSA_CORE_NAME)).tar define HOST_GCC_XTENSA_OVERLAY_EXTRACT tar xf $(HOST_GCC_XTENSA_OVERLAY_TAR) -C $(@D) --strip-components=1 gcc endef # # Apply patches # ifeq ($(ARCH),powerpc) ifneq ($(BR2_SOFT_FLOAT),) define HOST_GCC_APPLY_POWERPC_PATCH $(APPLY_PATCHES) $(@D) package/gcc/$(GCC_VERSION) 1000-powerpc-link-with-math-lib.patch.conditional endef endif endif # gcc is a special package, not named gcc, but gcc-initial and # gcc-final, but patches are nonetheless stored in package/gcc in the # tree, and potentially in BR2_GLOBAL_PATCH_DIR directories as well. define HOST_GCC_APPLY_PATCHES for patchdir in \ package/gcc/$(GCC_VERSION) \ $(addsuffix /gcc/$(GCC_VERSION),$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) \ $(addsuffix /gcc,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) ; do \ if test -d $${patchdir}; then \ $(APPLY_PATCHES) $(@D) $${patchdir} \*.patch || exit 1; \ fi; \ done $(HOST_GCC_APPLY_POWERPC_PATCH) endef HOST_GCC_EXCLUDES = \ libjava/* libgo/* \ gcc/testsuite/* libstdc++-v3/testsuite/* define HOST_GCC_FAKE_TESTSUITE mkdir -p $(@D)/libstdc++-v3/testsuite/ echo "all:" > $(@D)/libstdc++-v3/testsuite/Makefile.in echo "install:" >> $(@D)/libstdc++-v3/testsuite/Makefile.in endef # # Create 'build' directory and configure symlink # define HOST_GCC_CONFIGURE_SYMLINK mkdir -p $(@D)/build ln -sf ../configure $(@D)/build/configure endef # # Common configuration options # HOST_GCC_COMMON_DEPENDENCIES = \ host-binutils \ host-gmp \ host-mpfr \ $(if $(BR2_BINFMT_FLAT),host-elf2flt) HOST_GCC_COMMON_CONF_OPTS = \ --target=$(GNU_TARGET_NAME) \ --with-sysroot=$(STAGING_DIR) \ --disable-__cxa_atexit \ --with-gnu-ld \ --disable-libssp \ --disable-multilib \ --with-gmp=$(HOST_DIR)/usr \ --with-mpfr=$(HOST_DIR)/usr \ --with-pkgversion="Buildroot $(BR2_VERSION_FULL)" \ --with-bugurl="http://bugs.buildroot.net/" # Don't build documentation. It takes up extra space / build time, # and sometimes needs specific makeinfo versions to work HOST_GCC_COMMON_CONF_ENV = \ MAKEINFO=missing GCC_COMMON_TARGET_CFLAGS = $(TARGET_CFLAGS) GCC_COMMON_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS) # Propagate options used for target software building to GCC target libs HOST_GCC_COMMON_CONF_ENV += CFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CFLAGS)" HOST_GCC_COMMON_CONF_ENV += CXXFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CXXFLAGS)" # libitm needs sparc V9+ ifeq ($(BR2_sparc_v8)$(BR2_sparc_leon3),y) HOST_GCC_COMMON_CONF_OPTS += --disable-libitm endif # quadmath support requires wchar ifeq ($(BR2_USE_WCHAR)$(BR2_TOOLCHAIN_HAS_LIBQUADMATH),yy) HOST_GCC_COMMON_CONF_OPTS += --enable-libquadmath else HOST_GCC_COMMON_CONF_OPTS += --disable-libquadmath endif # libsanitizer requires wordexp, not in default uClibc config. Also # doesn't build properly with musl. ifeq ($(BR2_TOOLCHAIN_BUILDROOT_UCLIBC)$(BR2_TOOLCHAIN_BUILDROOT_MUSL),y) HOST_GCC_COMMON_CONF_OPTS += --disable-libsanitizer endif # libsanitizer is broken for SPARC # https://bugs.busybox.net/show_bug.cgi?id=7951 ifeq ($(BR2_sparc)$(BR2_sparc64),y) HOST_GCC_COMMON_CONF_OPTS += --disable-libsanitizer endif ifeq ($(BR2_GCC_ENABLE_TLS),y) HOST_GCC_COMMON_CONF_OPTS += --enable-tls else HOST_GCC_COMMON_CONF_OPTS += --disable-tls endif ifeq ($(BR2_GCC_ENABLE_LTO),y) HOST_GCC_COMMON_CONF_OPTS += --enable-plugins --enable-lto endif ifeq ($(BR2_GCC_ENABLE_LIBMUDFLAP),y) HOST_GCC_COMMON_CONF_OPTS += --enable-libmudflap else HOST_GCC_COMMON_CONF_OPTS += --disable-libmudflap endif ifeq ($(BR2_PTHREADS_NONE),y) HOST_GCC_COMMON_CONF_OPTS += \ --disable-threads \ --disable-libitm \ --disable-libatomic else HOST_GCC_COMMON_CONF_OPTS += --enable-threads endif ifeq ($(BR2_GCC_NEEDS_MPC),y) HOST_GCC_COMMON_DEPENDENCIES += host-mpc HOST_GCC_COMMON_CONF_OPTS += --with-mpc=$(HOST_DIR)/usr endif ifeq ($(BR2_GCC_ENABLE_GRAPHITE),y) HOST_GCC_COMMON_DEPENDENCIES += host-isl HOST_GCC_COMMON_CONF_OPTS += --with-isl=$(HOST_DIR)/usr # gcc 5 doesn't need cloog any more, see # https://gcc.gnu.org/gcc-5/changes.html ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_5),) HOST_GCC_COMMON_DEPENDENCIES += host-cloog HOST_GCC_COMMON_CONF_OPTS += --with-cloog=$(HOST_DIR)/usr endif else HOST_GCC_COMMON_CONF_OPTS += --without-isl --without-cloog endif ifeq ($(BR2_arc),y) HOST_GCC_COMMON_DEPENDENCIES += host-flex host-bison endif ifeq ($(BR2_SOFT_FLOAT),y) # only mips*-*-*, arm*-*-* and sparc*-*-* accept --with-float # powerpc seems to be needing it as well ifeq ($(BR2_arm)$(BR2_armeb)$(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el)$(BR2_powerpc)$(BR2_sparc),y) HOST_GCC_COMMON_CONF_OPTS += --with-float=soft endif endif ifeq ($(BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE),y) HOST_GCC_COMMON_CONF_OPTS += --disable-decimal-float endif # Determine arch/tune/abi/cpu options ifeq ($(BR2_GCC_ARCH_HAS_CONFIGURABLE_DEFAULTS),y) ifneq ($(call qstrip,$(BR2_GCC_TARGET_ARCH)),) HOST_GCC_COMMON_CONF_OPTS += --with-arch=$(BR2_GCC_TARGET_ARCH) endif ifneq ($(call qstrip,$(BR2_GCC_TARGET_ABI)),) HOST_GCC_COMMON_CONF_OPTS += --with-abi=$(BR2_GCC_TARGET_ABI) endif ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),) ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU_REVISION)),) HOST_GCC_COMMON_CONF_OPTS += --with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISION)) else HOST_GCC_COMMON_CONF_OPTS += --with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU)) endif endif GCC_TARGET_FPU = $(call qstrip,$(BR2_GCC_TARGET_FPU)) ifneq ($(GCC_TARGET_FPU),) HOST_GCC_COMMON_CONF_OPTS += --with-fpu=$(GCC_TARGET_FPU) endif GCC_TARGET_FLOAT_ABI = $(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI)) ifneq ($(GCC_TARGET_FLOAT_ABI),) HOST_GCC_COMMON_CONF_OPTS += --with-float=$(GCC_TARGET_FLOAT_ABI) endif GCC_TARGET_MODE = $(call qstrip,$(BR2_GCC_TARGET_MODE)) ifneq ($(GCC_TARGET_MODE),) HOST_GCC_COMMON_CONF_OPTS += --with-mode=$(GCC_TARGET_MODE) endif endif # BR2_GCC_ARCH_HAS_CONFIGURABLE_DEFAULTS # Enable proper double/long double for SPE ABI ifeq ($(BR2_powerpc_SPE),y) HOST_GCC_COMMON_CONF_OPTS += \ --enable-e500_double \ --with-long-double-128 endif HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_CROSS_PATH_SUFFIX='".br_real"' ifeq ($(BR2_GCC_ARCH_HAS_CONFIGURABLE_DEFAULTS),) ifeq ($(call qstrip,$(BR2_GCC_TARGET_CPU_REVISION)),) HOST_GCC_COMMON_WRAPPER_TARGET_CPU := $(call qstrip,$(BR2_GCC_TARGET_CPU)) else HOST_GCC_COMMON_WRAPPER_TARGET_CPU := $(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISION)) endif HOST_GCC_COMMON_WRAPPER_TARGET_ARCH := $(call qstrip,$(BR2_GCC_TARGET_ARCH)) HOST_GCC_COMMON_WRAPPER_TARGET_ABI := $(call qstrip,$(BR2_GCC_TARGET_ABI)) HOST_GCC_COMMON_WRAPPER_TARGET_FPU := $(call qstrip,$(BR2_GCC_TARGET_FPU)) HOST_GCC_COMMON_WRAPPER_TARGET_FLOAT_ABI := $(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI)) HOST_GCC_COMMON_WRAPPER_TARGET_MODE := $(call qstrip,$(BR2_GCC_TARGET_MODE)) ifneq ($(HOST_GCC_COMMON_WRAPPER_TARGET_ARCH),) HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_ARCH='"$(HOST_GCC_COMMON_WRAPPER_TARGET_ARCH)"' endif ifneq ($(HOST_GCC_COMMON_WRAPPER_TARGET_CPU),) HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_CPU='"$(HOST_GCC_COMMON_WRAPPER_TARGET_CPU)"' endif ifneq ($(HOST_GCC_COMMON_WRAPPER_TARGET_ABI),) HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_ABI='"$(HOST_GCC_COMMON_WRAPPER_TARGET_ABI)"' endif ifneq ($(HOST_GCC_COMMON_WRAPPER_TARGET_FPU),) HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_FPU='"$(HOST_GCC_COMMON_WRAPPER_TARGET_FPU)"' endif ifneq ($(HOST_GCC_COMMON_WRAPPER_TARGET_FLOATABI_),) HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_FLOAT_ABI='"$(HOST_GCC_COMMON_WRAPPER_TARGET_FLOATABI_)"' endif ifneq ($(HOST_GCC_COMMON_WRAPPER_TARGET_MODE),) HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_MODE='"$(HOST_GCC_COMMON_WRAPPER_TARGET_MODE)"' endif endif # !BR2_GCC_ARCH_HAS_CONFIGURABLE_DEFAULTS # For gcc-initial, we need to tell gcc that the C library will be # providing the ssp support, as it can't guess it since the C library # hasn't been built yet. # # For gcc-final, the gcc logic to detect whether SSP support is # available or not in the C library is not working properly for # uClibc, so let's be explicit as well. HOST_GCC_COMMON_MAKE_OPTS = \ gcc_cv_libc_provides_ssp=$(if $(BR2_TOOLCHAIN_HAS_SSP),yes,no) ifeq ($(BR2_CCACHE),y) HOST_GCC_COMMON_CCACHE_HASH_FILES += $(DL_DIR)/$(GCC_SOURCE) # Cfr. PATCH_BASE_DIRS in .stamp_patched, but we catch both versioned # and unversioned patches unconditionally. Moreover, to facilitate the # addition of gcc patches in BR2_GLOBAL_PATCH_DIR, we allow them to be # stored in a sub-directory called 'gcc' even if it's not technically # the name of the package. HOST_GCC_COMMON_CCACHE_HASH_FILES += \ $(sort $(wildcard \ package/gcc/$(GCC_VERSION)/*.patch \ $(addsuffix /$($(PKG)_RAWNAME)/$(GCC_VERSION)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) \ $(addsuffix /$($(PKG)_RAWNAME)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) \ $(addsuffix /gcc/$(GCC_VERSION)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) \ $(addsuffix /gcc/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))))) ifeq ($(BR2_xtensa),y) HOST_GCC_COMMON_CCACHE_HASH_FILES += $(HOST_GCC_XTENSA_OVERLAY_TAR) endif ifeq ($(ARCH),powerpc) ifneq ($(BR2_SOFT_FLOAT),) HOST_GCC_COMMON_CCACHE_HASH_FILES += package/gcc/$(GCC_VERSION)/1000-powerpc-link-with-math-lib.patch.conditional endif endif # _CONF_OPTS contains some references to the absolute path of $(HOST_DIR) # and a reference to the Buildroot git revision (BR2_VERSION_FULL), # so substitute those away. HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_CCACHE_HASH=\"`\ printf '%s\n' $(subst $(HOST_DIR),@HOST_DIR@,\ $(subst --with-pkgversion="Buildroot $(BR2_VERSION_FULL)",,$($(PKG)_CONF_OPTS))) \ | sha256sum - $(HOST_GCC_COMMON_CCACHE_HASH_FILES) \ | cut -c -64 | tr -d '\n'`\" endif # BR2_CCACHE # The LTO support in gcc creates wrappers for ar, ranlib and nm which load # the lto plugin. These wrappers are called *-gcc-ar, *-gcc-ranlib, and # *-gcc-nm and should be used instead of the real programs when -flto is # used. However, we should not add the toolchain wrapper for them, and they # match the *cc-* pattern. Therefore, an additional case is added for *-ar, # *-ranlib and *-nm. # According to gfortran manpage, it supports all options supported by gcc, so # add gfortran to the list of the program called via the Buildroot wrapper. # Avoid that a .br_real is symlinked a second time. # Also create <arch>-linux-<tool> symlinks. define HOST_GCC_INSTALL_WRAPPER_AND_SIMPLE_SYMLINKS $(Q)cd $(HOST_DIR)/usr/bin; \ for i in $(GNU_TARGET_NAME)-*; do \ case "$$i" in \ *.br_real) \ ;; \ *-ar|*-ranlib|*-nm) \ ln -snf $$i $(ARCH)-linux$${i##$(GNU_TARGET_NAME)}; \ ;; \ *cc|*cc-*|*++|*++-*|*cpp|*-gfortran) \ rm -f $$i.br_real; \ mv $$i $$i.br_real; \ ln -sf toolchain-wrapper $$i; \ ln -sf toolchain-wrapper $(ARCH)-linux$${i##$(GNU_TARGET_NAME)}; \ ln -snf $$i.br_real $(ARCH)-linux$${i##$(GNU_TARGET_NAME)}.br_real; \ ;; \ *) \ ln -snf $$i $(ARCH)-linux$${i##$(GNU_TARGET_NAME)}; \ ;; \ esac; \ done endef include $(sort $(wildcard package/gcc/*/*.mk))
shibajee/buildroot
package/gcc/gcc.mk
mk
mit
11,726
config BR2_PACKAGE_GCR bool "gcr" depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # gnupg2 depends on BR2_USE_WCHAR # libglib2 depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2 depends on BR2_USE_MMU # libglib2 depends on !BR2_STATIC_LIBS # p11-kit select BR2_PACKAGE_GNUPG2 # runtime select BR2_PACKAGE_LIBGCRYPT select BR2_PACKAGE_LIBGLIB2 select BR2_PACKAGE_P11_KIT help Library for cryptographic UIs and accessing PKCS#11 modules. https://developer.gnome.org/gcr/ comment "gcr needs a toolchain w/ wchar, threads, dynamic library" depends on BR2_USE_MMU depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \ BR2_STATIC_LIBS
shibajee/buildroot
package/gcr/Config.in
in
mit
658
# From http://ftp.acc.umu.se/pub/gnome/sources/gcr/3.20/gcr-3.20.0.sha256sum sha256 90572c626d8a708225560c42b4421f7941315247fa1679d4ef569bde7f4bb379 gcr-3.20.0.tar.xz
shibajee/buildroot
package/gcr/gcr.hash
hash
mit
167
################################################################################ # # gcr # ################################################################################ GCR_VERSION_MAJOR = 3.20 GCR_VERSION = $(GCR_VERSION_MAJOR).0 GCR_SITE = http://ftp.acc.umu.se/pub/gnome/sources/gcr/$(GCR_VERSION_MAJOR) GCR_SOURCE = gcr-$(GCR_VERSION).tar.xz GCR_DEPENDENCIES = host-intltool host-pkgconf libgcrypt libglib2 p11-kit GCR_INSTALL_STAGING = YES GCR_CONF_ENV = ac_cv_path_GNUPG=/usr/bin/gpg2 GCR_CONF_OPTS = \ --disable-gtk-doc \ --with-libgcrypt-prefix=$(STAGING_DIR)/usr # Even though COPYING is v2 the code states v2.1+ GCR_LICENSE = LGPLv2.1+ GCR_LICENSE_FILES = COPYING # Only the X11 backend is supported for the simple GUI ifeq ($(BR2_PACKAGE_LIBGTK3_X11),y) GCR_DEPENDENCIES += libgtk3 GCR_CONF_OPTS += --with-gtk else GCR_CONF_OPTS += --without-gtk endif $(eval $(autotools-package))
shibajee/buildroot
package/gcr/gcr.mk
mk
mit
900
Fix gdlib-config Since the @LIBICONV@ macro doesn't get replaced at compile time, we end up installing an invalid gdlib-config: the gdlib-config --libs says that one should link against @LIBICONV@ which obviously doesn't work. Use the OpenWRT patch from https://dev.openwrt.org/browser/packages/libs/gd/patches/101-gdlib-config.patch Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- a/config/gdlib-config.in +++ b/config/gdlib-config.in @@ -71,7 +71,7 @@ while test $# -gt 0; do echo @LDFLAGS@ ;; --libs) - echo -lgd @LIBS@ @LIBICONV@ + echo -lgd @LIBS@ ;; --cflags|--includes) echo -I@includedir@ @@ -84,7 +84,7 @@ while test $# -gt 0; do echo "includedir: $includedir" echo "cflags: -I@includedir@" echo "ldflags: @LDFLAGS@" - echo "libs: @LIBS@ @LIBICONV@" + echo "libs: @LIBS@" echo "libdir: $libdir" echo "features: @FEATURES@" ;;
shibajee/buildroot
package/gd/0001-gdlib-config.patch
patch
mit
920
From ea2a03e983acf34a1320b460dcad43b7e0b0b14f Mon Sep 17 00:00:00 2001 Message-Id: <ea2a03e983acf34a1320b460dcad43b7e0b0b14f.1397134306.git.baruch@tkos.co.il> From: Baruch Siach <baruch@tkos.co.il> Date: Thu, 10 Apr 2014 15:49:13 +0300 Subject: [PATCH] gd_bmp: fix build with uClibc Some architectures (like ARM) don't have the long double variants of math functions under uClibc. Add a local ceill definition in this case. Patch status: reported upstream, https://bitbucket.org/libgd/gd-libgd/issue/123/build-failure-agains-uclibc-arm Signed-off-by: Baruch Siach <baruch@tkos.co.il> --- src/gd_bmp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gd_bmp.c b/src/gd_bmp.c index 0fc021909f1b..11b3ec1baa01 100644 --- a/src/gd_bmp.c +++ b/src/gd_bmp.c @@ -25,6 +25,11 @@ #include "gdhelpers.h" #include "bmp.h" +#include <features.h> +#if defined (__UCLIBC__) && !defined(__UCLIBC_HAS_LONG_DOUBLE_MATH__) +#define NO_LONG_DOUBLE +#endif + static int compress_row(unsigned char *uncompressed_row, int length); static int build_rle_packet(unsigned char *row, int packet_type, int length, unsigned char *data); @@ -42,6 +47,13 @@ static int bmp_read_rle(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info); #define BMP_DEBUG(s) +#ifdef NO_LONG_DOUBLE +long double ceill(long double x) +{ + return (long double) ceil((double) x); +} +#endif + static int gdBMPPutWord(gdIOCtx *out, int w) { /* Byte order is little-endian */ -- 1.9.1
shibajee/buildroot
package/gd/0002-gd_bmp-fix-build-with-uClibc.patch
patch
mit
1,474
menuconfig BR2_PACKAGE_GD bool "gd" help GD is a graphics library. It allows your code to quickly draw images complete with lines, arcs, text, multiple colours, cut and paste from other images, flood fills, and write out the result as a PNG file. This is particularly useful in World Wide Web applications, where PNG is one of the formats accepted for inline images by most browsers. https://libgd.github.io/ if BR2_PACKAGE_GD config BR2_PACKAGE_GD_ANNOTATE bool "annotate" config BR2_PACKAGE_GD_BDFTOGD bool "bdftogd" depends on BR2_PACKAGE_PERL config BR2_PACKAGE_GD_GD2COPYPAL bool "gd2copypal" config BR2_PACKAGE_GD_GD2TOGIF bool "gd2togif" config BR2_PACKAGE_GD_GD2TOPNG bool "gd2topng" select BR2_PACKAGE_LIBPNG config BR2_PACKAGE_GD_GDCMPGIF bool "gdcmpgif" config BR2_PACKAGE_GD_GDPARTTOPNG bool "gdparttopng" select BR2_PACKAGE_LIBPNG config BR2_PACKAGE_GD_GDTOPNG bool "gdtopng" select BR2_PACKAGE_LIBPNG config BR2_PACKAGE_GD_GIFTOGD2 bool "giftogd2" config BR2_PACKAGE_GD_PNGTOGD bool "pngtogd" select BR2_PACKAGE_LIBPNG config BR2_PACKAGE_GD_PNGTOGD2 bool "pngtogd2" select BR2_PACKAGE_LIBPNG config BR2_PACKAGE_GD_WEBPNG bool "webpng" select BR2_PACKAGE_LIBPNG endif
shibajee/buildroot
package/gd/Config.in
in
mit
1,238
# Locally calculated sha256 489f756ce07f0c034b1a794f4d34fdb4d829256112cb3c36feb40bb56b79218c libgd-2.2.2.tar.xz
shibajee/buildroot
package/gd/gd.hash
hash
mit
112
################################################################################ # # gd # ################################################################################ GD_VERSION = 2.2.2 GD_SOURCE = libgd-$(GD_VERSION).tar.xz GD_SITE = https://github.com/libgd/libgd/releases/download/gd-$(GD_VERSION) GD_INSTALL_STAGING = YES GD_LICENSE = GD license GD_LICENSE_FILES = COPYING GD_CONFIG_SCRIPTS = gdlib-config GD_CONF_OPTS = --without-x --disable-rpath GD_DEPENDENCIES = host-pkgconf # gd forgets to link utilities with -pthread even though it uses # pthreads, causing linking errors with static linking ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) GD_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -pthread" endif ifeq ($(BR2_PACKAGE_FONTCONFIG),y) GD_DEPENDENCIES += fontconfig GD_CONF_OPTS += --with-fontconfig endif ifeq ($(BR2_PACKAGE_FREETYPE),y) GD_DEPENDENCIES += freetype GD_CONF_OPTS += --with-freetype=$(STAGING_DIR)/usr else GD_CONF_OPTS += --without-freetype endif ifeq ($(BR2_PACKAGE_LIBICONV),y) GD_DEPENDENCIES += libiconv # not strictly needed for gd, but ensures -liconv ends up in # gdlib-config --libs output GD_CONF_ENV += LIBS="-liconv" endif ifeq ($(BR2_PACKAGE_JPEG),y) GD_DEPENDENCIES += jpeg GD_CONF_OPTS += --with-jpeg endif ifeq ($(BR2_PACKAGE_LIBPNG),y) GD_DEPENDENCIES += libpng GD_CONF_OPTS += --with-png else GD_CONF_OPTS += --without-png endif ifeq ($(BR2_PACKAGE_WEBP),y) GD_DEPENDENCIES += webp GD_CONF_OPTS += --with-webp else GD_CONF_OPTS += --without-webp endif ifeq ($(BR2_PACKAGE_TIFF),y) GD_DEPENDENCIES += tiff GD_CONF_OPTS += --with-tiff else GD_CONF_OPTS += --without-tiff endif ifeq ($(BR2_PACKAGE_XLIB_LIBXPM),y) GD_DEPENDENCIES += xlib_libXpm GD_CONF_OPTS += --with-xpm endif ifeq ($(BR2_PACKAGE_ZLIB),y) GD_DEPENDENCIES += zlib endif GD_TOOLS_$(BR2_PACKAGE_GD_ANNOTATE) += annotate GD_TOOLS_$(BR2_PACKAGE_GD_BDFTOGD) += bdftogd GD_TOOLS_$(BR2_PACKAGE_GD_GD2COPYPAL) += gd2copypal GD_TOOLS_$(BR2_PACKAGE_GD_GD2TOGIF) += gd2togif GD_TOOLS_$(BR2_PACKAGE_GD_GD2TOPNG) += gd2topng GD_TOOLS_$(BR2_PACKAGE_GD_GDCMPGIF) += gdcmpgif GD_TOOLS_$(BR2_PACKAGE_GD_GDPARTTOPNG) += gdparttopng GD_TOOLS_$(BR2_PACKAGE_GD_GDTOPNG) += gdtopng GD_TOOLS_$(BR2_PACKAGE_GD_GIFTOGD2) += giftogd2 GD_TOOLS_$(BR2_PACKAGE_GD_PNGTOGD) += pngtogd GD_TOOLS_$(BR2_PACKAGE_GD_PNGTOGD2) += pngtogd2 GD_TOOLS_$(BR2_PACKAGE_GD_WEBPNG) += webpng define GD_REMOVE_TOOLS rm -f $(addprefix $(TARGET_DIR)/usr/bin/,$(GD_TOOLS_)) endef GD_POST_INSTALL_TARGET_HOOKS += GD_REMOVE_TOOLS $(eval $(autotools-package))
shibajee/buildroot
package/gd/gd.mk
mk
mit
2,524
From d41401ace01c234f42697e190a2ac95991780626 Mon Sep 17 00:00:00 2001 From: Doug Evans <dje@google.com> Date: Mon, 26 Oct 2015 13:20:12 -0700 Subject: [PATCH] Add some casts for building on musl. gdb/ChangeLog: * linux-thread-db.c (find_new_threads_callback): Cast ti.ti_tid to unsigned long for debug_printf. (thread_db_pid_to_str): Ditto. gdb/gdbserver/ChangeLog: * thread-db.c (find_one_thread): Cast ti.ti_tid to unsigned long for debug_printf. (attach_thread, find_new_threads_callback): Ditto. [Arnout: removed the parts that don't apply, including ChangeLog] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> --- gdb/ChangeLog | 5 +++++ gdb/gdbserver/ChangeLog | 6 ++++++ gdb/gdbserver/thread-db.c | 9 +++++---- gdb/linux-thread-db.c | 5 +++-- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c index ffe722d..3df10ff 100644 --- a/gdb/gdbserver/thread-db.c +++ b/gdb/gdbserver/thread-db.c @@ -278,7 +278,7 @@ find_one_thread (ptid_t ptid) if (debug_threads) debug_printf ("Found thread %ld (LWP %d)\n", - ti.ti_tid, ti.ti_lid); + (unsigned long) ti.ti_tid, ti.ti_lid); if (lwpid != ti.ti_lid) { @@ -319,12 +319,12 @@ attach_thread (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p) if (debug_threads) debug_printf ("Attaching to thread %ld (LWP %d)\n", - ti_p->ti_tid, ti_p->ti_lid); + (unsigned long) ti_p->ti_tid, ti_p->ti_lid); err = linux_attach_lwp (ptid); if (err != 0) { warning ("Could not attach to thread %ld (LWP %d): %s\n", - ti_p->ti_tid, ti_p->ti_lid, + (unsigned long) ti_p->ti_tid, ti_p->ti_lid, linux_ptrace_attach_fail_reason_string (ptid, err)); return 0; } @@ -392,7 +392,8 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data) glibc PR17707. */ if (debug_threads) debug_printf ("thread_db: skipping exited and " - "joined thread (0x%lx)\n", ti.ti_tid); + "joined thread (0x%lx)\n", + (unsigned long) ti.ti_tid); return 0; } diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 66e9595..41db29a 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -1585,7 +1585,8 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data) if (libthread_db_debug) fprintf_unfiltered (gdb_stdlog, "thread_db: skipping exited and " - "joined thread (0x%lx)\n", ti.ti_tid); + "joined thread (0x%lx)\n", + (unsigned long) ti.ti_tid); return 0; } @@ -1816,7 +1817,7 @@ thread_db_pid_to_str (struct target_ops *ops, ptid_t ptid) tid = thread_info->priv->tid; snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)", - tid, ptid_get_lwp (ptid)); + (unsigned long) tid, ptid_get_lwp (ptid)); return buf; } -- 1.9.4
shibajee/buildroot
package/gdb/7.10.1/0001-Add-some-casts-for-building-on-musl.patch
patch
mit
2,913
From 963843d4d07aef6caa296dacf191f8adc9518596 Mon Sep 17 00:00:00 2001 From: Doug Evans <dje@google.com> Date: Mon, 26 Oct 2015 13:24:01 -0700 Subject: [PATCH] musl: Move W_STOPCODE to common/gdb_wait.h. gdb/ChangeLog: * common/gdb_wait.h (W_STOPCODE): Define, moved here from gdbserver/linux-low.c. (WSETSTOP): Simplify. gdb/gdbserver/ChangeLog: * linux-low.c (W_STOPCODE): Moved to common/gdb_wait.h. [Arnout: removed the parts that don't apply, including ChangeLog] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> --- gdb/ChangeLog | 6 ++++++ gdb/common/gdb_wait.h | 8 ++++---- gdb/gdbserver/ChangeLog | 4 ++++ gdb/gdbserver/linux-low.c | 4 ---- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/gdb/common/gdb_wait.h b/gdb/common/gdb_wait.h index 9b250d2..412f813 100644 --- a/gdb/common/gdb_wait.h +++ b/gdb/common/gdb_wait.h @@ -85,12 +85,12 @@ # endif #endif +#ifndef W_STOPCODE +#define W_STOPCODE(sig) ((sig) << 8 | 0x7f) +#endif + #ifndef WSETSTOP -# ifdef W_STOPCODE #define WSETSTOP(w,sig) ((w) = W_STOPCODE(sig)) -# else -#define WSETSTOP(w,sig) ((w) = (0177 | ((sig) << 8))) -# endif #endif /* For native GNU/Linux we may use waitpid and the __WCLONE option. diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 0c552b8..7ed67c7 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -70,10 +70,6 @@ #define O_LARGEFILE 0 #endif -#ifndef W_STOPCODE -#define W_STOPCODE(sig) ((sig) << 8 | 0x7f) -#endif - /* This is the kernel's hard limit. Not to be confused with SIGRTMIN. */ #ifndef __SIGRTMIN -- 1.9.4
shibajee/buildroot
package/gdb/7.10.1/0002-musl-Move-W_STOPCODE-to-common-gdb_wait-h.patch
patch
mit
1,656
From 682b25469e66ea45b214e95962671373983c118f Mon Sep 17 00:00:00 2001 From: Doug Evans <dje@google.com> Date: Mon, 26 Oct 2015 13:30:57 -0700 Subject: [PATCH] Move __SIGRTMIN. gdb/ChangeLog: * nat/linux-nat.h (__SIGRTMIN): Move here from gdbserver/linux-low.c. gdb/gdbserver/ChangeLog: * linux-low.c (__SIGRTMIN): Move to nat/linux-nat.h. [Arnout: removed the parts that don't apply, including ChangeLog] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> --- gdb/ChangeLog | 4 ++++ gdb/gdbserver/ChangeLog | 4 ++++ gdb/gdbserver/linux-low.c | 6 ------ gdb/nat/linux-nat.h | 5 +++++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 7ed67c7..e778c4c 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -70,12 +70,6 @@ #define O_LARGEFILE 0 #endif -/* This is the kernel's hard limit. Not to be confused with - SIGRTMIN. */ -#ifndef __SIGRTMIN -#define __SIGRTMIN 32 -#endif - /* Some targets did not define these ptrace constants from the start, so gdbserver defines them locally here. In the future, these may be removed after they are added to asm/ptrace.h. */ diff --git a/gdb/nat/linux-nat.h b/gdb/nat/linux-nat.h index 0633fa9..70e6274 100644 --- a/gdb/nat/linux-nat.h +++ b/gdb/nat/linux-nat.h @@ -25,6 +25,11 @@ struct lwp_info; struct arch_lwp_info; +/* This is the kernel's hard limit. Not to be confused with SIGRTMIN. */ +#ifndef __SIGRTMIN +#define __SIGRTMIN 32 +#endif + /* Unlike other extended result codes, WSTOPSIG (status) on PTRACE_O_TRACESYSGOOD syscall events doesn't return SIGTRAP, but instead SIGTRAP with bit 7 set. */ -- 1.9.4
shibajee/buildroot
package/gdb/7.10.1/0003-move-__SIGRTMIN.patch
patch
mit
1,739
From d4eb69fc4b50f9a0babd70b28d0601b40f31bd0f Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Thu, 2 Jul 2015 15:10:58 +0300 Subject: [PATCH] xtensa: implement NPTL helpers These changes allow debugging multithreaded NPTL xtensa applications. 2015-08-20 Max Filippov <jcmvbkbc@gmail.com> gdb/gdbserver/ * configure.srv (xtensa*-*-linux*): Add srv_linux_thread_db=yes. * linux-xtensa-low.c (arch/xtensa.h gdb_proc_service.h): New #includes. (ps_get_thread_area): New function. 2015-08-20 Max Filippov <jcmvbkbc@gmail.com> gdb/ * arch/xtensa.h: New file. * xtensa-linux-nat.c (gdb_proc_service.h): New #include. (ps_get_thread_area): New function. * xtensa-linux-tdep.c (xtensa_linux_init_abi): Add call to set_gdbarch_fetch_tls_load_module_address to enable TLS support. * xtensa-tdep.c (osabi.h): New #include. (xtensa_gdbarch_init): Call gdbarch_init_osabi to register xtensa-specific hooks. * xtensa-tdep.h (struct xtensa_elf_gregset_t): Add threadptr member and move the structure to arch/xtensa.h. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: 40045d91812b25c88c8275b8c08d27c234b68ba8 Changes to ChangeLog files are dropped. gdb/arch/xtensa.h | 46 ++++++++++++++++++++++++++++++++++++++++ gdb/gdbserver/configure.srv | 1 + gdb/gdbserver/linux-xtensa-low.c | 21 ++++++++++++++++++ gdb/xtensa-linux-nat.c | 22 ++++++++++++++++++ gdb/xtensa-linux-tdep.c | 4 ++++ gdb/xtensa-tdep.c | 4 ++++ gdb/xtensa-tdep.h | 24 ++------------------ 7 files changed, 100 insertions(+), 22 deletions(-) create mode 100644 gdb/arch/xtensa.h diff --git a/gdb/arch/xtensa.h b/gdb/arch/xtensa.h new file mode 100644 index 0000000..fe96584 --- /dev/null +++ b/gdb/arch/xtensa.h @@ -0,0 +1,46 @@ +/* Common Target-dependent code for the Xtensa port of GDB, the GNU debugger. + + Copyright (C) 2003-2015 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef XTENSA_H +#define XTENSA_H + +/* Xtensa ELF core file register set representation ('.reg' section). + Copied from target-side ELF header <xtensa/elf.h>. */ + +typedef uint32_t xtensa_elf_greg_t; + +typedef struct +{ + xtensa_elf_greg_t pc; + xtensa_elf_greg_t ps; + xtensa_elf_greg_t lbeg; + xtensa_elf_greg_t lend; + xtensa_elf_greg_t lcount; + xtensa_elf_greg_t sar; + xtensa_elf_greg_t windowstart; + xtensa_elf_greg_t windowbase; + xtensa_elf_greg_t threadptr; + xtensa_elf_greg_t reserved[7+48]; + xtensa_elf_greg_t ar[64]; +} xtensa_elf_gregset_t; + +#define XTENSA_ELF_NGREG (sizeof (xtensa_elf_gregset_t) \ + / sizeof (xtensa_elf_greg_t)) + +#endif diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv index 0b18d1d..320c26a 100644 --- a/gdb/gdbserver/configure.srv +++ b/gdb/gdbserver/configure.srv @@ -352,6 +352,7 @@ case "${target}" in xtensa*-*-linux*) srv_regobj=reg-xtensa.o srv_tgtobj="$srv_linux_obj linux-xtensa-low.o" srv_linux_regsets=yes + srv_linux_thread_db=yes ;; tilegx-*-linux*) srv_regobj=reg-tilegx.o srv_regobj="${srv_regobj} reg-tilegx32.o" diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c index 4daccee..debe467 100644 --- a/gdb/gdbserver/linux-xtensa-low.c +++ b/gdb/gdbserver/linux-xtensa-low.c @@ -26,6 +26,8 @@ extern const struct target_desc *tdesc_xtensa; #include <asm/ptrace.h> #include <xtensa-config.h> +#include "arch/xtensa.h" +#include "gdb_proc_service.h" #include "xtensa-xtregs.c" @@ -179,6 +181,25 @@ xtensa_breakpoint_at (CORE_ADDR where) xtensa_breakpoint, xtensa_breakpoint_len) == 0; } +/* Called by libthread_db. */ + +ps_err_e +ps_get_thread_area (const struct ps_prochandle *ph, + lwpid_t lwpid, int idx, void **base) +{ + xtensa_elf_gregset_t regs; + + if (ptrace (PTRACE_GETREGS, lwpid, NULL, &regs) != 0) + return PS_ERR; + + /* IDX is the bias from the thread pointer to the beginning of the + thread descriptor. It has to be subtracted due to implementation + quirks in libthread_db. */ + *base = (void *) ((char *) regs.threadptr - idx); + + return PS_OK; +} + static struct regsets_info xtensa_regsets_info = { xtensa_regsets, /* regsets */ diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c index 77ad3e0..5538d5b 100644 --- a/gdb/xtensa-linux-nat.c +++ b/gdb/xtensa-linux-nat.c @@ -37,6 +37,9 @@ #include "gregset.h" #include "xtensa-tdep.h" +/* Defines ps_err_e, struct ps_prochandle. */ +#include "gdb_proc_service.h" + /* Extended register set depends on hardware configs. Keeping these definitions separately allows to introduce hardware-specific overlays. */ @@ -280,6 +283,25 @@ xtensa_linux_store_inferior_registers (struct target_ops *ops, store_xtregs (regcache, regnum); } +/* Called by libthread_db. */ + +ps_err_e +ps_get_thread_area (const struct ps_prochandle *ph, + lwpid_t lwpid, int idx, void **base) +{ + xtensa_elf_gregset_t regs; + + if (ptrace (PTRACE_GETREGS, lwpid, NULL, &regs) != 0) + return PS_ERR; + + /* IDX is the bias from the thread pointer to the beginning of the + thread descriptor. It has to be subtracted due to implementation + quirks in libthread_db. */ + *base = (void *) ((char *) regs.threadptr - idx); + + return PS_OK; +} + void _initialize_xtensa_linux_nat (void); void diff --git a/gdb/xtensa-linux-tdep.c b/gdb/xtensa-linux-tdep.c index 61ea9b0..99e0d3e 100644 --- a/gdb/xtensa-linux-tdep.c +++ b/gdb/xtensa-linux-tdep.c @@ -106,6 +106,10 @@ xtensa_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) xtensa_linux_gdb_signal_from_target); set_gdbarch_gdb_signal_to_target (gdbarch, xtensa_linux_gdb_signal_to_target); + + /* Enable TLS support. */ + set_gdbarch_fetch_tls_load_module_address (gdbarch, + svr4_fetch_objfile_link_map); } /* Provide a prototype to silence -Wmissing-prototypes. */ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index 55e7d98..4b693ed 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -28,6 +28,7 @@ #include "value.h" #include "dis-asm.h" #include "inferior.h" +#include "osabi.h" #include "floatformat.h" #include "regcache.h" #include "reggroups.h" @@ -3273,6 +3274,9 @@ xtensa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); + /* Hook in the ABI-specific overrides, if they have been registered. */ + gdbarch_init_osabi (info, gdbarch); + return gdbarch; } diff --git a/gdb/xtensa-tdep.h b/gdb/xtensa-tdep.h index caa2988..5b28cab 100644 --- a/gdb/xtensa-tdep.h +++ b/gdb/xtensa-tdep.h @@ -18,6 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "arch/xtensa.h" + /* XTENSA_TDEP_VERSION can/should be changed along with XTENSA_CONFIG_VERSION whenever the "tdep" structure changes in an incompatible way. */ @@ -81,28 +83,6 @@ typedef enum } xtensa_target_flags_t; -/* Xtensa ELF core file register set representation ('.reg' section). - Copied from target-side ELF header <xtensa/elf.h>. */ - -typedef uint32_t xtensa_elf_greg_t; - -typedef struct -{ - xtensa_elf_greg_t pc; - xtensa_elf_greg_t ps; - xtensa_elf_greg_t lbeg; - xtensa_elf_greg_t lend; - xtensa_elf_greg_t lcount; - xtensa_elf_greg_t sar; - xtensa_elf_greg_t windowstart; - xtensa_elf_greg_t windowbase; - xtensa_elf_greg_t reserved[8+48]; - xtensa_elf_greg_t ar[64]; -} xtensa_elf_gregset_t; - -#define XTENSA_ELF_NGREG (sizeof (xtensa_elf_gregset_t) \ - / sizeof (xtensa_elf_greg_t)) - /* Mask. */ typedef struct -- 1.8.1.4
shibajee/buildroot
package/gdb/7.10.1/0004-xtensa-implement-NPTL-helpers.patch
patch
mit
8,456
From cd68d0ebe7748a5448c86eb021b717df6fe83f35 Mon Sep 17 00:00:00 2001 From: Doug Evans <xdje42@gmail.com> Date: Sun, 22 Nov 2015 17:24:03 -0800 Subject: [PATCH] target.h: #include <sys/types.h>. For musl. [Romain: rebase on gdb 7.10.1 from upstream (7.11) remove ChangeLog entry] Signed-off-by: Romain Naour <romain.naour@gmail.com> --- gdb/gdbserver/target.h | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h index 9a40867..6af043c 100644 --- a/gdb/gdbserver/target.h +++ b/gdb/gdbserver/target.h @@ -21,6 +21,7 @@ #ifndef TARGET_H #define TARGET_H +#include <sys/types.h> /* for mode_t */ #include "target/target.h" #include "target/resume.h" #include "target/wait.h" -- 2.5.5
shibajee/buildroot
package/gdb/7.10.1/0005-target.h-include-sys-types.h.patch
patch
mit
746
From 4d913bb73965fdb9c756e8d5916a829b60aa3a44 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Date: Thu, 4 Aug 2016 23:44:24 +0200 Subject: [PATCH] Revert "sim: unify SIM_CPU definition" This reverts commit 20bca71d82598a015de0991196e45f0b5f7ead81. This change causes a redefinition of SIM_CPU on the Blackfin architecture, as it is defined in both the common sim/common/sim-base.h and the architecture specific sim/bfin/sim-main.h. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- sim/arm/sim-main.h | 3 +++ sim/avr/sim-main.h | 2 ++ sim/bfin/sim-main.h | 2 -- sim/common/sim-base.h | 2 -- sim/cr16/sim-main.h | 2 ++ sim/cris/sim-main.h | 5 +++++ sim/d10v/sim-main.h | 2 ++ sim/frv/sim-main.h | 10 ++++++++++ sim/ft32/sim-main.h | 2 ++ sim/h8300/sim-main.h | 3 +++ sim/iq2000/sim-main.h | 5 +++++ sim/lm32/sim-main.h | 5 +++++ sim/m32r/sim-main.h | 5 +++++ sim/m68hc11/sim-main.h | 3 +++ sim/mcore/sim-main.h | 2 ++ sim/microblaze/sim-main.h | 3 +++ sim/mips/sim-main.h | 3 +++ sim/mn10300/sim-main.h | 2 ++ sim/moxie/sim-main.h | 3 +++ sim/msp430/sim-main.h | 3 +++ sim/sh/sim-main.h | 3 +++ sim/sh64/sim-main.h | 5 +++++ sim/v850/sim-main.h | 3 +++ 23 files changed, 74 insertions(+), 4 deletions(-) diff --git a/sim/arm/sim-main.h b/sim/arm/sim-main.h index 9a37b98..ae622bd 100644 --- a/sim/arm/sim-main.h +++ b/sim/arm/sim-main.h @@ -20,6 +20,9 @@ #define SIM_MAIN_H #include "sim-basics.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" #include "bfd.h" diff --git a/sim/avr/sim-main.h b/sim/avr/sim-main.h index e0cac22..52904e3 100644 --- a/sim/avr/sim-main.h +++ b/sim/avr/sim-main.h @@ -23,6 +23,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ extern unsigned int pc; +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" struct _sim_cpu { diff --git a/sim/bfin/sim-main.h b/sim/bfin/sim-main.h index 806fe15..53e1774 100644 --- a/sim/bfin/sim-main.h +++ b/sim/bfin/sim-main.h @@ -24,8 +24,6 @@ #include "sim-basics.h" #include "sim-signal.h" -/* TODO: Delete this. Need to convert bu32/etc... to common sim types - and unwind the bfin-sim.h/machs.h include below first though. */ typedef struct _sim_cpu SIM_CPU; #include "bfin-sim.h" diff --git a/sim/common/sim-base.h b/sim/common/sim-base.h index 21f61f4..e90e07c 100644 --- a/sim/common/sim-base.h +++ b/sim/common/sim-base.h @@ -72,8 +72,6 @@ typedef address_word sim_cia; #define INVALID_INSTRUCTION_ADDRESS ((address_word)0 - 1) #endif -/* TODO: Probably should just delete SIM_CPU. */ -typedef struct _sim_cpu SIM_CPU; typedef struct _sim_cpu sim_cpu; #include "sim-module.h" diff --git a/sim/cr16/sim-main.h b/sim/cr16/sim-main.h index a63b93e..1a80229 100644 --- a/sim/cr16/sim-main.h +++ b/sim/cr16/sim-main.h @@ -24,6 +24,8 @@ typedef long int word; typedef unsigned long int uword; +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" #include "bfd.h" diff --git a/sim/cris/sim-main.h b/sim/cris/sim-main.h index 4dc04a2..fec0039 100644 --- a/sim/cris/sim-main.h +++ b/sim/cris/sim-main.h @@ -24,6 +24,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef SIM_MAIN_H #define SIM_MAIN_H +#define USING_SIM_BASE_H + +struct _sim_cpu; +typedef struct _sim_cpu SIM_CPU; + #include "symcat.h" #include "sim-basics.h" #include "cgen-types.h" diff --git a/sim/d10v/sim-main.h b/sim/d10v/sim-main.h index 0b87811..a7d59dd 100644 --- a/sim/d10v/sim-main.h +++ b/sim/d10v/sim-main.h @@ -24,6 +24,8 @@ typedef long int word; typedef unsigned long int uword; +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" #include "bfd.h" diff --git a/sim/frv/sim-main.h b/sim/frv/sim-main.h index d5a67cb..fd12c4f 100644 --- a/sim/frv/sim-main.h +++ b/sim/frv/sim-main.h @@ -19,6 +19,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Main header for the frv. */ +#define USING_SIM_BASE_H /* FIXME: quick hack */ + +struct _sim_cpu; /* FIXME: should be in sim-basics.h */ +typedef struct _sim_cpu SIM_CPU; + +/* Set the mask of unsupported traces. */ +#define WITH_TRACE \ + (~(TRACE_alu | TRACE_decode | TRACE_memory | TRACE_model | TRACE_fpu \ + | TRACE_branch | TRACE_debug)) + /* sim-basics.h includes config.h but cgen-types.h must be included before sim-basics.h and cgen-types.h needs config.h. */ #include "config.h" diff --git a/sim/ft32/sim-main.h b/sim/ft32/sim-main.h index b27a690..a270a5d 100644 --- a/sim/ft32/sim-main.h +++ b/sim/ft32/sim-main.h @@ -25,6 +25,8 @@ #include "sim-base.h" #include "bfd.h" +typedef struct _sim_cpu SIM_CPU; + #include "ft32-sim.h" struct _sim_cpu { diff --git a/sim/h8300/sim-main.h b/sim/h8300/sim-main.h index 6dbc1ac..e95c4d9 100644 --- a/sim/h8300/sim-main.h +++ b/sim/h8300/sim-main.h @@ -87,6 +87,9 @@ enum h8_typecodes { }; #include "sim-basics.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" /* Structure used to describe addressing */ diff --git a/sim/iq2000/sim-main.h b/sim/iq2000/sim-main.h index 992520a..ce3baba 100644 --- a/sim/iq2000/sim-main.h +++ b/sim/iq2000/sim-main.h @@ -4,6 +4,11 @@ #ifndef SIM_MAIN_H #define SIM_MAIN_H +#define USING_SIM_BASE_H /* FIXME: quick hack */ + +struct _sim_cpu; /* FIXME: should be in sim-basics.h */ +typedef struct _sim_cpu SIM_CPU; + /* sim-basics.h includes config.h but cgen-types.h must be included before sim-basics.h and cgen-types.h needs config.h. */ #include "config.h" diff --git a/sim/lm32/sim-main.h b/sim/lm32/sim-main.h index 4894e8d..210bb8b 100644 --- a/sim/lm32/sim-main.h +++ b/sim/lm32/sim-main.h @@ -23,6 +23,11 @@ #ifndef SIM_MAIN_H #define SIM_MAIN_H +#define USING_SIM_BASE_H /* FIXME: quick hack */ + +struct _sim_cpu; /* FIXME: should be in sim-basics.h */ +typedef struct _sim_cpu SIM_CPU; + #include "symcat.h" #include "sim-basics.h" #include "cgen-types.h" diff --git a/sim/m32r/sim-main.h b/sim/m32r/sim-main.h index cd39e98..74bb513 100644 --- a/sim/m32r/sim-main.h +++ b/sim/m32r/sim-main.h @@ -3,6 +3,11 @@ #ifndef SIM_MAIN_H #define SIM_MAIN_H +#define USING_SIM_BASE_H /* FIXME: quick hack */ + +struct _sim_cpu; /* FIXME: should be in sim-basics.h */ +typedef struct _sim_cpu SIM_CPU; + #include "symcat.h" #include "sim-basics.h" #include "cgen-types.h" diff --git a/sim/m68hc11/sim-main.h b/sim/m68hc11/sim-main.h index d1fc582..4f41db9 100644 --- a/sim/m68hc11/sim-main.h +++ b/sim/m68hc11/sim-main.h @@ -25,6 +25,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define SIM_HANDLES_LMA 1 #include "sim-basics.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-signal.h" #include "sim-base.h" diff --git a/sim/mcore/sim-main.h b/sim/mcore/sim-main.h index be50ec1..25698c1 100644 --- a/sim/mcore/sim-main.h +++ b/sim/mcore/sim-main.h @@ -24,6 +24,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ typedef long int word; typedef unsigned long int uword; +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" #include "bfd.h" diff --git a/sim/microblaze/sim-main.h b/sim/microblaze/sim-main.h index 6781374..6b7b776 100644 --- a/sim/microblaze/sim-main.h +++ b/sim/microblaze/sim-main.h @@ -20,6 +20,9 @@ #include "microblaze.h" #include "sim-basics.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" /* The machine state. diff --git a/sim/mips/sim-main.h b/sim/mips/sim-main.h index 8d698ad..9729804 100644 --- a/sim/mips/sim-main.h +++ b/sim/mips/sim-main.h @@ -29,6 +29,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ mips_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), (TRANSFER), (ERROR)) #include "sim-basics.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" #include "bfd.h" diff --git a/sim/mn10300/sim-main.h b/sim/mn10300/sim-main.h index 847506e..2ddbfb9 100644 --- a/sim/mn10300/sim-main.h +++ b/sim/mn10300/sim-main.h @@ -42,6 +42,8 @@ #include "itable.h" #include "idecode.h" +typedef struct _sim_cpu SIM_CPU; + #define WITH_WATCHPOINTS 1 #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \ diff --git a/sim/moxie/sim-main.h b/sim/moxie/sim-main.h index b1a64fc..c60437e 100644 --- a/sim/moxie/sim-main.h +++ b/sim/moxie/sim-main.h @@ -21,6 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define SIM_MAIN_H #include "sim-basics.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" #include "bfd.h" diff --git a/sim/msp430/sim-main.h b/sim/msp430/sim-main.h index 19c8cca..37bb42d 100644 --- a/sim/msp430/sim-main.h +++ b/sim/msp430/sim-main.h @@ -23,6 +23,9 @@ #include "sim-basics.h" #include "sim-signal.h" + +typedef struct _sim_cpu SIM_CPU; + #include "msp430-sim.h" #include "sim-base.h" diff --git a/sim/sh/sim-main.h b/sim/sh/sim-main.h index e67df28..e2e17d7 100644 --- a/sim/sh/sim-main.h +++ b/sim/sh/sim-main.h @@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define SIM_MAIN_H #include "sim-basics.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" typedef struct diff --git a/sim/sh64/sim-main.h b/sim/sh64/sim-main.h index 7b24ab0..8fb595e 100644 --- a/sim/sh64/sim-main.h +++ b/sim/sh64/sim-main.h @@ -3,6 +3,11 @@ #ifndef SIM_MAIN_H #define SIM_MAIN_H +#define USING_SIM_BASE_H /* FIXME: quick hack */ + +struct _sim_cpu; /* FIXME: should be in sim-basics.h */ +typedef struct _sim_cpu SIM_CPU; + /* sim-basics.h includes config.h but cgen-types.h must be included before sim-basics.h and cgen-types.h needs config.h. */ #include "config.h" diff --git a/sim/v850/sim-main.h b/sim/v850/sim-main.h index 5127d28..16cbd97 100644 --- a/sim/v850/sim-main.h +++ b/sim/v850/sim-main.h @@ -16,6 +16,9 @@ #include "sim-basics.h" #include "sim-signal.h" #include "sim-fpu.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" #include "simops.h" -- 2.7.4
shibajee/buildroot
package/gdb/7.10.1/0006-Revert-sim-unify-SIM_CPU-definition.patch
patch
mit
10,252
From 77080d5f7fd47dd567f22807d336bc9111f93d7b Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Date: Thu, 4 Aug 2016 23:44:24 +0200 Subject: [PATCH] Revert "sim: unify SIM_CPU definition" This reverts commit 20bca71d82598a015de0991196e45f0b5f7ead81. This change causes a redefinition of SIM_CPU on the Blackfin architecture, as it is defined in both the common sim/common/sim-base.h and the architecture specific sim/bfin/sim-main.h. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- sim/arm/sim-main.h | 3 +++ sim/avr/sim-main.h | 2 ++ sim/bfin/sim-main.h | 2 -- sim/common/sim-base.h | 2 -- sim/cr16/sim-main.h | 2 ++ sim/cris/sim-main.h | 3 +++ sim/d10v/sim-main.h | 2 ++ sim/frv/sim-main.h | 3 +++ sim/ft32/sim-main.h | 2 ++ sim/h8300/sim-main.h | 3 +++ sim/iq2000/sim-main.h | 3 +++ sim/lm32/sim-main.h | 3 +++ sim/m32r/sim-main.h | 3 +++ sim/m68hc11/sim-main.h | 3 +++ sim/mcore/sim-main.h | 2 ++ sim/microblaze/sim-main.h | 3 +++ sim/mips/sim-main.h | 3 +++ sim/mn10300/sim-main.h | 2 ++ sim/moxie/sim-main.h | 3 +++ sim/msp430/sim-main.h | 3 +++ sim/sh/sim-main.h | 3 +++ sim/sh64/sim-main.h | 3 +++ sim/v850/sim-main.h | 3 +++ 23 files changed, 57 insertions(+), 4 deletions(-) diff --git a/sim/arm/sim-main.h b/sim/arm/sim-main.h index 3620810..f644122 100644 --- a/sim/arm/sim-main.h +++ b/sim/arm/sim-main.h @@ -20,6 +20,9 @@ #define SIM_MAIN_H #include "sim-basics.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" #include "bfd.h" diff --git a/sim/avr/sim-main.h b/sim/avr/sim-main.h index 47155e3..cd41045 100644 --- a/sim/avr/sim-main.h +++ b/sim/avr/sim-main.h @@ -21,6 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "sim-basics.h" +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" struct _sim_cpu { diff --git a/sim/bfin/sim-main.h b/sim/bfin/sim-main.h index 51fb87e..cf1ed57 100644 --- a/sim/bfin/sim-main.h +++ b/sim/bfin/sim-main.h @@ -24,8 +24,6 @@ #include "sim-basics.h" #include "sim-signal.h" -/* TODO: Delete this. Need to convert bu32/etc... to common sim types - and unwind the bfin-sim.h/machs.h include below first though. */ typedef struct _sim_cpu SIM_CPU; #include "bfin-sim.h" diff --git a/sim/common/sim-base.h b/sim/common/sim-base.h index 350b352..1b849f4 100644 --- a/sim/common/sim-base.h +++ b/sim/common/sim-base.h @@ -72,8 +72,6 @@ typedef address_word sim_cia; #define INVALID_INSTRUCTION_ADDRESS ((address_word)0 - 1) #endif -/* TODO: Probably should just delete SIM_CPU. */ -typedef struct _sim_cpu SIM_CPU; typedef struct _sim_cpu sim_cpu; #include "sim-module.h" diff --git a/sim/cr16/sim-main.h b/sim/cr16/sim-main.h index 208f917..78e3996 100644 --- a/sim/cr16/sim-main.h +++ b/sim/cr16/sim-main.h @@ -24,6 +24,8 @@ typedef long int word; typedef unsigned long int uword; +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" #include "bfd.h" diff --git a/sim/cris/sim-main.h b/sim/cris/sim-main.h index 8aab970..0ff907f 100644 --- a/sim/cris/sim-main.h +++ b/sim/cris/sim-main.h @@ -29,6 +29,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ one of -scache/-pbb. */ #define WITH_SCACHE_PBB 1 +struct _sim_cpu; +typedef struct _sim_cpu SIM_CPU; + #include "symcat.h" #include "sim-basics.h" #include "cgen-types.h" diff --git a/sim/d10v/sim-main.h b/sim/d10v/sim-main.h index 76f06d8..fd5bd51 100644 --- a/sim/d10v/sim-main.h +++ b/sim/d10v/sim-main.h @@ -24,6 +24,8 @@ typedef long int word; typedef unsigned long int uword; +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" #include "bfd.h" diff --git a/sim/frv/sim-main.h b/sim/frv/sim-main.h index f95c1cc..701e208 100644 --- a/sim/frv/sim-main.h +++ b/sim/frv/sim-main.h @@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Main header for the frv. */ +struct _sim_cpu; /* FIXME: should be in sim-basics.h */ +typedef struct _sim_cpu SIM_CPU; + /* sim-basics.h includes config.h but cgen-types.h must be included before sim-basics.h and cgen-types.h needs config.h. */ #include "config.h" diff --git a/sim/ft32/sim-main.h b/sim/ft32/sim-main.h index a15b247..eef0201 100644 --- a/sim/ft32/sim-main.h +++ b/sim/ft32/sim-main.h @@ -25,6 +25,8 @@ #include "sim-base.h" #include "bfd.h" +typedef struct _sim_cpu SIM_CPU; + #include "ft32-sim.h" struct _sim_cpu { diff --git a/sim/h8300/sim-main.h b/sim/h8300/sim-main.h index 6dbc1ac..e95c4d9 100644 --- a/sim/h8300/sim-main.h +++ b/sim/h8300/sim-main.h @@ -87,6 +87,9 @@ enum h8_typecodes { }; #include "sim-basics.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" /* Structure used to describe addressing */ diff --git a/sim/iq2000/sim-main.h b/sim/iq2000/sim-main.h index 829f9bb..a770dc5 100644 --- a/sim/iq2000/sim-main.h +++ b/sim/iq2000/sim-main.h @@ -4,6 +4,9 @@ #ifndef SIM_MAIN_H #define SIM_MAIN_H +struct _sim_cpu; /* FIXME: should be in sim-basics.h */ +typedef struct _sim_cpu SIM_CPU; + /* sim-basics.h includes config.h but cgen-types.h must be included before sim-basics.h and cgen-types.h needs config.h. */ #include "config.h" diff --git a/sim/lm32/sim-main.h b/sim/lm32/sim-main.h index 20e2b71..eeffde3 100644 --- a/sim/lm32/sim-main.h +++ b/sim/lm32/sim-main.h @@ -25,6 +25,9 @@ #define WITH_SCACHE_PBB 1 +struct _sim_cpu; /* FIXME: should be in sim-basics.h */ +typedef struct _sim_cpu SIM_CPU; + #include "symcat.h" #include "sim-basics.h" #include "cgen-types.h" diff --git a/sim/m32r/sim-main.h b/sim/m32r/sim-main.h index 5b24ce8..39f7ecc 100644 --- a/sim/m32r/sim-main.h +++ b/sim/m32r/sim-main.h @@ -8,6 +8,9 @@ one of -scache/-pbb. */ #define WITH_SCACHE_PBB 1 +struct _sim_cpu; /* FIXME: should be in sim-basics.h */ +typedef struct _sim_cpu SIM_CPU; + #include "symcat.h" #include "sim-basics.h" #include "cgen-types.h" diff --git a/sim/m68hc11/sim-main.h b/sim/m68hc11/sim-main.h index b940df7..0aa096f 100644 --- a/sim/m68hc11/sim-main.h +++ b/sim/m68hc11/sim-main.h @@ -21,6 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define _SIM_MAIN_H #include "sim-basics.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-signal.h" #include "sim-base.h" diff --git a/sim/mcore/sim-main.h b/sim/mcore/sim-main.h index fce26e8..fa7ee9f 100644 --- a/sim/mcore/sim-main.h +++ b/sim/mcore/sim-main.h @@ -24,6 +24,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ typedef long int word; typedef unsigned long int uword; +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" #include "bfd.h" diff --git a/sim/microblaze/sim-main.h b/sim/microblaze/sim-main.h index 3a7b088..9e6bf01 100644 --- a/sim/microblaze/sim-main.h +++ b/sim/microblaze/sim-main.h @@ -20,6 +20,9 @@ #include "microblaze.h" #include "sim-basics.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" /* The machine state. diff --git a/sim/mips/sim-main.h b/sim/mips/sim-main.h index 0ea1234..eedbfc9 100644 --- a/sim/mips/sim-main.h +++ b/sim/mips/sim-main.h @@ -27,6 +27,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ mips_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), (TRANSFER), (ERROR)) #include "sim-basics.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" #include "bfd.h" diff --git a/sim/mn10300/sim-main.h b/sim/mn10300/sim-main.h index 7171c03..3a917e7 100644 --- a/sim/mn10300/sim-main.h +++ b/sim/mn10300/sim-main.h @@ -38,6 +38,8 @@ #include "itable.h" #include "idecode.h" +typedef struct _sim_cpu SIM_CPU; + #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \ mn10300_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), (TRANSFER), (ERROR)) diff --git a/sim/moxie/sim-main.h b/sim/moxie/sim-main.h index 7091f21..b6b5ca3 100644 --- a/sim/moxie/sim-main.h +++ b/sim/moxie/sim-main.h @@ -21,6 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define SIM_MAIN_H #include "sim-basics.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" #include "bfd.h" diff --git a/sim/msp430/sim-main.h b/sim/msp430/sim-main.h index 4a2ab22..c7cdc5e 100644 --- a/sim/msp430/sim-main.h +++ b/sim/msp430/sim-main.h @@ -23,6 +23,9 @@ #include "sim-basics.h" #include "sim-signal.h" + +typedef struct _sim_cpu SIM_CPU; + #include "msp430-sim.h" #include "sim-base.h" diff --git a/sim/sh/sim-main.h b/sim/sh/sim-main.h index 4af7b03..6ab42a6 100644 --- a/sim/sh/sim-main.h +++ b/sim/sh/sim-main.h @@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define SIM_MAIN_H #include "sim-basics.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" typedef struct diff --git a/sim/sh64/sim-main.h b/sim/sh64/sim-main.h index da8f516..5fd7095 100644 --- a/sim/sh64/sim-main.h +++ b/sim/sh64/sim-main.h @@ -3,6 +3,9 @@ #ifndef SIM_MAIN_H #define SIM_MAIN_H +struct _sim_cpu; /* FIXME: should be in sim-basics.h */ +typedef struct _sim_cpu SIM_CPU; + /* sim-basics.h includes config.h but cgen-types.h must be included before sim-basics.h and cgen-types.h needs config.h. */ #include "config.h" diff --git a/sim/v850/sim-main.h b/sim/v850/sim-main.h index e7276a6..1a45f97 100644 --- a/sim/v850/sim-main.h +++ b/sim/v850/sim-main.h @@ -9,6 +9,9 @@ #include "sim-basics.h" #include "sim-signal.h" #include "sim-fpu.h" + +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" #include "simops.h" -- 2.7.4
shibajee/buildroot
package/gdb/7.11.1/0001-Revert-sim-unify-SIM_CPU-definition.patch
patch
mit
9,814
From 570805e96bb8c458795b04f4745700795997ef40 Mon Sep 17 00:00:00 2001 From: Romain Naour <romain.naour@openwide.fr> Date: Fri, 10 Apr 2015 22:58:07 +0200 Subject: [PATCH] gdbserver: fix uClibc whithout MMU. Since commit d86d4aafd4fa22fa4cccb83253fb187b03f97f48, the pid must be retrieved from current_thread. The change has not been made in the function linux_read_offsets(). Fixes: http://autobuild.buildroot.net/results/9e4/9e4df085319e346803c26c65478accb27eb950ae/build-end.log Signed-off-by: Romain Naour <romain.naour@openwide.fr> --- gdb/gdbserver/linux-low.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 4d19c87..7585b80 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -4933,7 +4933,7 @@ static int linux_read_offsets (CORE_ADDR *text_p, CORE_ADDR *data_p) { unsigned long text, text_end, data; - int pid = lwpid_of (get_thread_lwp (current_thread)); + int pid = lwpid_of (current_thread); errno = 0; -- 1.9.3
shibajee/buildroot
package/gdb/7.9.1/0001-gdbserver-fix-uClibc-whithout-MMU.patch
patch
mit
1,048
From deb44829ecc1dd38275af0fcf91acd319e227a89 Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Fri, 17 Apr 2015 03:07:41 +0300 Subject: [PATCH 1/2] gdbserver/xtensa: drop xtensa_usrregs_info xtensa_usrregs_info refers to undefined variables xtensa_num_regs and xtensa_regmap. Drop xtensa_usrregs_info and replace pointer to usrregs in regs_info with NULL since all registers are read/set through regsets. 2015-04-17 Max Filippov <jcmvbkbc@gmail.com> gdb/gdbserver/ * linux-xtensa-low.c (xtensa_usrregs_info): Remove. (regs_info): Replace usrregs pointer with NULL. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: deb44829ecc1dd38275af0fcf91acd319e227a89 Changes to ChangeLog are dropped. gdb/gdbserver/linux-xtensa-low.c | 8 +------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c index f7fafaf..e786da5 100644 --- a/gdb/gdbserver/linux-xtensa-low.c +++ b/gdb/gdbserver/linux-xtensa-low.c @@ -186,16 +186,10 @@ static struct regsets_info xtensa_regsets_info = NULL, /* disabled_regsets */ }; -static struct usrregs_info xtensa_usrregs_info = - { - xtensa_num_regs, - xtensa_regmap, - }; - static struct regs_info regs_info = { NULL, /* regset_bitmap */ - &xtensa_usrregs_info, + NULL, /* usrregs */ &xtensa_regsets_info }; -- 1.8.1.4
shibajee/buildroot
package/gdb/7.9.1/0002-gdbserver-xtensa-drop-xtensa_usrregs_info.patch
patch
mit
1,417
From a2d5a9d76f2366ed93095fc5a63eafa06b22f808 Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Fri, 17 Apr 2015 02:52:50 +0300 Subject: [PATCH 2/2] gdbserver/xtensa: fix typo in XCHAL_HAVE_LOOPS This fixes lbeg/lend/lcount registers handling through gdbserver. 2015-04-17 Max Filippov <jcmvbkbc@gmail.com> gdb/gdbserver/ * linux-xtensa-low.c (xtensa_fill_gregset) (xtensa_store_gregset): Check XCHAL_HAVE_LOOPS instead of XCHAL_HAVE_LOOP. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: a2d5a9d76f2366ed93095fc5a63eafa06b22f808 Changes to ChangeLog are dropped. gdb/gdbserver/linux-xtensa-low.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c index e786da5..4daccee 100644 --- a/gdb/gdbserver/linux-xtensa-low.c +++ b/gdb/gdbserver/linux-xtensa-low.c @@ -59,7 +59,7 @@ xtensa_fill_gregset (struct regcache *regcache, void *buf) /* Loop registers, if hardware has it. */ -#if XCHAL_HAVE_LOOP +#if XCHAL_HAVE_LOOPS collect_register_by_name (regcache, "lbeg", (char*)&rset[R_LBEG]); collect_register_by_name (regcache, "lend", (char*)&rset[R_LEND]); collect_register_by_name (regcache, "lcount", (char*)&rset[R_LCOUNT]); @@ -94,7 +94,7 @@ xtensa_store_gregset (struct regcache *regcache, const void *buf) /* Loop registers, if hardware has it. */ -#if XCHAL_HAVE_LOOP +#if XCHAL_HAVE_LOOPS supply_register_by_name (regcache, "lbeg", (char*)&rset[R_LBEG]); supply_register_by_name (regcache, "lend", (char*)&rset[R_LEND]); supply_register_by_name (regcache, "lcount", (char*)&rset[R_LCOUNT]); -- 1.8.1.4
shibajee/buildroot
package/gdb/7.9.1/0003-gdbserver-xtensa-fix-typo-in-XCHAL_HAVE_LOOPS.patch
patch
mit
1,683
From d4eb69fc4b50f9a0babd70b28d0601b40f31bd0f Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Thu, 2 Jul 2015 15:10:58 +0300 Subject: [PATCH] xtensa: implement NPTL helpers These changes allow debugging multithreaded NPTL xtensa applications. 2015-08-20 Max Filippov <jcmvbkbc@gmail.com> gdb/gdbserver/ * configure.srv (xtensa*-*-linux*): Add srv_linux_thread_db=yes. * linux-xtensa-low.c (arch/xtensa.h gdb_proc_service.h): New #includes. (ps_get_thread_area): New function. 2015-08-20 Max Filippov <jcmvbkbc@gmail.com> gdb/ * arch/xtensa.h: New file. * xtensa-linux-nat.c (gdb_proc_service.h): New #include. (ps_get_thread_area): New function. * xtensa-linux-tdep.c (xtensa_linux_init_abi): Add call to set_gdbarch_fetch_tls_load_module_address to enable TLS support. * xtensa-tdep.c (osabi.h): New #include. (xtensa_gdbarch_init): Call gdbarch_init_osabi to register xtensa-specific hooks. * xtensa-tdep.h (struct xtensa_elf_gregset_t): Add threadptr member and move the structure to arch/xtensa.h. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: 40045d91812b25c88c8275b8c08d27c234b68ba8 Changes to ChangeLog files are dropped. gdb/arch/xtensa.h | 46 ++++++++++++++++++++++++++++++++++++++++ gdb/gdbserver/configure.srv | 1 + gdb/gdbserver/linux-xtensa-low.c | 21 ++++++++++++++++++ gdb/xtensa-linux-nat.c | 22 ++++++++++++++++++ gdb/xtensa-linux-tdep.c | 4 ++++ gdb/xtensa-tdep.c | 4 ++++ gdb/xtensa-tdep.h | 24 ++------------------ 7 files changed, 100 insertions(+), 22 deletions(-) create mode 100644 gdb/arch/xtensa.h diff --git a/gdb/arch/xtensa.h b/gdb/arch/xtensa.h new file mode 100644 index 0000000..fe96584 --- /dev/null +++ b/gdb/arch/xtensa.h @@ -0,0 +1,46 @@ +/* Common Target-dependent code for the Xtensa port of GDB, the GNU debugger. + + Copyright (C) 2003-2015 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef XTENSA_H +#define XTENSA_H + +/* Xtensa ELF core file register set representation ('.reg' section). + Copied from target-side ELF header <xtensa/elf.h>. */ + +typedef uint32_t xtensa_elf_greg_t; + +typedef struct +{ + xtensa_elf_greg_t pc; + xtensa_elf_greg_t ps; + xtensa_elf_greg_t lbeg; + xtensa_elf_greg_t lend; + xtensa_elf_greg_t lcount; + xtensa_elf_greg_t sar; + xtensa_elf_greg_t windowstart; + xtensa_elf_greg_t windowbase; + xtensa_elf_greg_t threadptr; + xtensa_elf_greg_t reserved[7+48]; + xtensa_elf_greg_t ar[64]; +} xtensa_elf_gregset_t; + +#define XTENSA_ELF_NGREG (sizeof (xtensa_elf_gregset_t) \ + / sizeof (xtensa_elf_greg_t)) + +#endif diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv index 0b18d1d..320c26a 100644 --- a/gdb/gdbserver/configure.srv +++ b/gdb/gdbserver/configure.srv @@ -352,6 +352,7 @@ case "${target}" in xtensa*-*-linux*) srv_regobj=reg-xtensa.o srv_tgtobj="$srv_linux_obj linux-xtensa-low.o" srv_linux_regsets=yes + srv_linux_thread_db=yes ;; tilegx-*-linux*) srv_regobj=reg-tilegx.o srv_regobj="${srv_regobj} reg-tilegx32.o" diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c index 4daccee..debe467 100644 --- a/gdb/gdbserver/linux-xtensa-low.c +++ b/gdb/gdbserver/linux-xtensa-low.c @@ -26,6 +26,8 @@ extern const struct target_desc *tdesc_xtensa; #include <asm/ptrace.h> #include <xtensa-config.h> +#include "arch/xtensa.h" +#include "gdb_proc_service.h" #include "xtensa-xtregs.c" @@ -179,6 +181,25 @@ xtensa_breakpoint_at (CORE_ADDR where) xtensa_breakpoint, xtensa_breakpoint_len) == 0; } +/* Called by libthread_db. */ + +ps_err_e +ps_get_thread_area (const struct ps_prochandle *ph, + lwpid_t lwpid, int idx, void **base) +{ + xtensa_elf_gregset_t regs; + + if (ptrace (PTRACE_GETREGS, lwpid, NULL, &regs) != 0) + return PS_ERR; + + /* IDX is the bias from the thread pointer to the beginning of the + thread descriptor. It has to be subtracted due to implementation + quirks in libthread_db. */ + *base = (void *) ((char *) regs.threadptr - idx); + + return PS_OK; +} + static struct regsets_info xtensa_regsets_info = { xtensa_regsets, /* regsets */ diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c index 77ad3e0..5538d5b 100644 --- a/gdb/xtensa-linux-nat.c +++ b/gdb/xtensa-linux-nat.c @@ -37,6 +37,9 @@ #include "gregset.h" #include "xtensa-tdep.h" +/* Defines ps_err_e, struct ps_prochandle. */ +#include "gdb_proc_service.h" + /* Extended register set depends on hardware configs. Keeping these definitions separately allows to introduce hardware-specific overlays. */ @@ -280,6 +283,25 @@ xtensa_linux_store_inferior_registers (struct target_ops *ops, store_xtregs (regcache, regnum); } +/* Called by libthread_db. */ + +ps_err_e +ps_get_thread_area (const struct ps_prochandle *ph, + lwpid_t lwpid, int idx, void **base) +{ + xtensa_elf_gregset_t regs; + + if (ptrace (PTRACE_GETREGS, lwpid, NULL, &regs) != 0) + return PS_ERR; + + /* IDX is the bias from the thread pointer to the beginning of the + thread descriptor. It has to be subtracted due to implementation + quirks in libthread_db. */ + *base = (void *) ((char *) regs.threadptr - idx); + + return PS_OK; +} + void _initialize_xtensa_linux_nat (void); void diff --git a/gdb/xtensa-linux-tdep.c b/gdb/xtensa-linux-tdep.c index 61ea9b0..99e0d3e 100644 --- a/gdb/xtensa-linux-tdep.c +++ b/gdb/xtensa-linux-tdep.c @@ -106,6 +106,10 @@ xtensa_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) xtensa_linux_gdb_signal_from_target); set_gdbarch_gdb_signal_to_target (gdbarch, xtensa_linux_gdb_signal_to_target); + + /* Enable TLS support. */ + set_gdbarch_fetch_tls_load_module_address (gdbarch, + svr4_fetch_objfile_link_map); } /* Provide a prototype to silence -Wmissing-prototypes. */ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index 55e7d98..4b693ed 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -28,6 +28,7 @@ #include "value.h" #include "dis-asm.h" #include "inferior.h" +#include "osabi.h" #include "floatformat.h" #include "regcache.h" #include "reggroups.h" @@ -3273,6 +3274,9 @@ xtensa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); + /* Hook in the ABI-specific overrides, if they have been registered. */ + gdbarch_init_osabi (info, gdbarch); + return gdbarch; } diff --git a/gdb/xtensa-tdep.h b/gdb/xtensa-tdep.h index caa2988..5b28cab 100644 --- a/gdb/xtensa-tdep.h +++ b/gdb/xtensa-tdep.h @@ -18,6 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "arch/xtensa.h" + /* XTENSA_TDEP_VERSION can/should be changed along with XTENSA_CONFIG_VERSION whenever the "tdep" structure changes in an incompatible way. */ @@ -81,28 +83,6 @@ typedef enum } xtensa_target_flags_t; -/* Xtensa ELF core file register set representation ('.reg' section). - Copied from target-side ELF header <xtensa/elf.h>. */ - -typedef uint32_t xtensa_elf_greg_t; - -typedef struct -{ - xtensa_elf_greg_t pc; - xtensa_elf_greg_t ps; - xtensa_elf_greg_t lbeg; - xtensa_elf_greg_t lend; - xtensa_elf_greg_t lcount; - xtensa_elf_greg_t sar; - xtensa_elf_greg_t windowstart; - xtensa_elf_greg_t windowbase; - xtensa_elf_greg_t reserved[8+48]; - xtensa_elf_greg_t ar[64]; -} xtensa_elf_gregset_t; - -#define XTENSA_ELF_NGREG (sizeof (xtensa_elf_gregset_t) \ - / sizeof (xtensa_elf_greg_t)) - /* Mask. */ typedef struct -- 1.8.1.4
shibajee/buildroot
package/gdb/7.9.1/0004-xtensa-implement-NPTL-helpers.patch
patch
mit
8,456
From d41401ace01c234f42697e190a2ac95991780626 Mon Sep 17 00:00:00 2001 From: Doug Evans <dje@google.com> Date: Mon, 26 Oct 2015 13:20:12 -0700 Subject: [PATCH] Add some casts for building on musl. gdb/ChangeLog: * linux-thread-db.c (find_new_threads_callback): Cast ti.ti_tid to unsigned long for debug_printf. (thread_db_pid_to_str): Ditto. gdb/gdbserver/ChangeLog: * thread-db.c (find_one_thread): Cast ti.ti_tid to unsigned long for debug_printf. (attach_thread, find_new_threads_callback): Ditto. [Arnout: removed the parts that don't apply, including ChangeLog] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> --- gdb/ChangeLog | 5 +++++ gdb/gdbserver/ChangeLog | 6 ++++++ gdb/gdbserver/thread-db.c | 9 +++++---- gdb/linux-thread-db.c | 5 +++-- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c index ffe722d..3df10ff 100644 --- a/gdb/gdbserver/thread-db.c +++ b/gdb/gdbserver/thread-db.c @@ -278,7 +278,7 @@ find_one_thread (ptid_t ptid) if (debug_threads) debug_printf ("Found thread %ld (LWP %d)\n", - ti.ti_tid, ti.ti_lid); + (unsigned long) ti.ti_tid, ti.ti_lid); if (lwpid != ti.ti_lid) { @@ -319,12 +319,12 @@ attach_thread (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p) if (debug_threads) debug_printf ("Attaching to thread %ld (LWP %d)\n", - ti_p->ti_tid, ti_p->ti_lid); + (unsigned long) ti_p->ti_tid, ti_p->ti_lid); err = linux_attach_lwp (ptid); if (err != 0) { warning ("Could not attach to thread %ld (LWP %d): %s\n", - ti_p->ti_tid, ti_p->ti_lid, + (unsigned long) ti_p->ti_tid, ti_p->ti_lid, linux_ptrace_attach_fail_reason_string (ptid, err)); return 0; } diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 66e9595..41db29a 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -1816,7 +1817,7 @@ thread_db_pid_to_str (struct target_ops *ops, ptid_t ptid) tid = thread_info->priv->tid; snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)", - tid, ptid_get_lwp (ptid)); + (unsigned long) tid, ptid_get_lwp (ptid)); return buf; } -- 1.9.4
shibajee/buildroot
package/gdb/7.9.1/0005-Add-some-casts-for-building-on-musl.patch
patch
mit
2,241
From 963843d4d07aef6caa296dacf191f8adc9518596 Mon Sep 17 00:00:00 2001 From: Doug Evans <dje@google.com> Date: Mon, 26 Oct 2015 13:24:01 -0700 Subject: [PATCH] musl: Move W_STOPCODE to common/gdb_wait.h. gdb/ChangeLog: * common/gdb_wait.h (W_STOPCODE): Define, moved here from gdbserver/linux-low.c. (WSETSTOP): Simplify. gdb/gdbserver/ChangeLog: * linux-low.c (W_STOPCODE): Moved to common/gdb_wait.h. [Arnout: removed the parts that don't apply, including ChangeLog] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> --- gdb/ChangeLog | 6 ++++++ gdb/common/gdb_wait.h | 8 ++++---- gdb/gdbserver/ChangeLog | 4 ++++ gdb/gdbserver/linux-low.c | 4 ---- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/gdb/common/gdb_wait.h b/gdb/common/gdb_wait.h index 9b250d2..412f813 100644 --- a/gdb/common/gdb_wait.h +++ b/gdb/common/gdb_wait.h @@ -85,12 +85,12 @@ # endif #endif +#ifndef W_STOPCODE +#define W_STOPCODE(sig) ((sig) << 8 | 0x7f) +#endif + #ifndef WSETSTOP -# ifdef W_STOPCODE #define WSETSTOP(w,sig) ((w) = W_STOPCODE(sig)) -# else -#define WSETSTOP(w,sig) ((w) = (0177 | ((sig) << 8))) -# endif #endif /* For native GNU/Linux we may use waitpid and the __WCLONE option. diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 0c552b8..7ed67c7 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -70,10 +70,6 @@ #define O_LARGEFILE 0 #endif -#ifndef W_STOPCODE -#define W_STOPCODE(sig) ((sig) << 8 | 0x7f) -#endif - /* This is the kernel's hard limit. Not to be confused with SIGRTMIN. */ #ifndef __SIGRTMIN -- 1.9.4
shibajee/buildroot
package/gdb/7.9.1/0006-musl-Move-W_STOPCODE-to-common-gdb_wait-h.patch
patch
mit
1,656
From 682b25469e66ea45b214e95962671373983c118f Mon Sep 17 00:00:00 2001 From: Doug Evans <dje@google.com> Date: Mon, 26 Oct 2015 13:30:57 -0700 Subject: [PATCH] Move __SIGRTMIN. gdb/ChangeLog: * nat/linux-nat.h (__SIGRTMIN): Move here from gdbserver/linux-low.c. gdb/gdbserver/ChangeLog: * linux-low.c (__SIGRTMIN): Move to nat/linux-nat.h. [Arnout: removed the parts that don't apply, including ChangeLog] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> --- gdb/ChangeLog | 4 ++++ gdb/gdbserver/ChangeLog | 4 ++++ gdb/gdbserver/linux-low.c | 6 ------ gdb/nat/linux-nat.h | 5 +++++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 7ed67c7..e778c4c 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -70,12 +70,6 @@ #define O_LARGEFILE 0 #endif -/* This is the kernel's hard limit. Not to be confused with - SIGRTMIN. */ -#ifndef __SIGRTMIN -#define __SIGRTMIN 32 -#endif - /* Some targets did not define these ptrace constants from the start, so gdbserver defines them locally here. In the future, these may be removed after they are added to asm/ptrace.h. */ diff --git a/gdb/nat/linux-nat.h b/gdb/nat/linux-nat.h index 0633fa9..70e6274 100644 --- a/gdb/nat/linux-nat.h +++ b/gdb/nat/linux-nat.h @@ -25,6 +25,11 @@ struct lwp_info; struct arch_lwp_info; +/* This is the kernel's hard limit. Not to be confused with SIGRTMIN. */ +#ifndef __SIGRTMIN +#define __SIGRTMIN 32 +#endif + /* Unlike other extended result codes, WSTOPSIG (status) on PTRACE_O_TRACESYSGOOD syscall events doesn't return SIGTRAP, but instead SIGTRAP with bit 7 set. */ -- 1.9.4
shibajee/buildroot
package/gdb/7.9.1/0007-move-__SIGRTMIN.patch
patch
mit
1,739
comment "gdb/gdbserver needs a toolchain w/ threads, threads debug" depends on !BR2_nios2 && !BR2_bfin depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_HAS_THREADS_DEBUG config BR2_PACKAGE_GDB bool "gdb" # When the external toolchain gdbserver is copied to the # target, we don't allow building a separate gdbserver. The # one from the external toolchain should be used. select BR2_PACKAGE_GDB_SERVER if \ (!BR2_PACKAGE_GDB_DEBUGGER && !BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY) depends on BR2_TOOLCHAIN_HAS_THREADS && BR2_TOOLCHAIN_HAS_THREADS_DEBUG depends on !BR2_nios2 && !BR2_bfin help GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it executes -- or what another program was doing at the moment it crashed. This option allows to build gdbserver and/or the gdb debugger for the target. For embedded development, the most common solution is to build only 'gdbserver' for the target, and use a cross-gdb on the host. See BR2_PACKAGE_HOST_GDB in the Toolchain menu to enable one. Notice that external toolchains often provide their own pre-built cross-gdb and gdbserver binaries. http://www.gnu.org/software/gdb/ if BR2_PACKAGE_GDB config BR2_PACKAGE_GDB_SERVER bool "gdbserver" depends on !BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY help Build the gdbserver stub to run on the target. A full gdb is needed to debug the progam. config BR2_PACKAGE_GDB_DEBUGGER bool "full debugger" select BR2_PACKAGE_NCURSES depends on BR2_USE_WCHAR depends on !BR2_sh && !BR2_sh64 && !BR2_microblaze comment "full gdb on target needs a toolchain w/ wchar" depends on !BR2_sh && !BR2_sh64 && !BR2_microblaze depends on !BR2_USE_WCHAR if BR2_PACKAGE_GDB_DEBUGGER config BR2_PACKAGE_GDB_TUI bool "TUI support" help This option enables terminal user interface (TUI) for gdb "The GDB Text User Interface (TUI) is a terminal interface which uses the curses library to show the source file, the assembly output, the program registers and GDB commands in separate text windows." https://sourceware.org/gdb/current/onlinedocs/gdb/TUI.html config BR2_PACKAGE_GDB_PYTHON bool "Python support" # Only Python 2.x is supported by gdb for now depends on BR2_PACKAGE_PYTHON help This option enables Python support in the target gdb. endif endif
shibajee/buildroot
package/gdb/Config.in
in
mit
2,368
config BR2_PACKAGE_HOST_GDB bool "Build cross gdb for the host" # When the external toolchain gdbserver is used, we shouldn't # allow to build a cross-gdb, as the one of the external # toolchain should be used. depends on !BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY depends on !BR2_nios2 help Build a cross gdb that runs on the host machine and debugs programs running on the target. It requires 'gdbserver' installed on the target, see BR2_PACKAGE_GDB_SERVER to enable it. if BR2_PACKAGE_HOST_GDB config BR2_PACKAGE_HOST_GDB_TUI bool "TUI support" help This option enables terminal user interface (TUI) for gdb config BR2_PACKAGE_HOST_GDB_PYTHON bool "Python support" help This option enables the Python support in the cross gdb. config BR2_PACKAGE_HOST_GDB_SIM bool "Simulator support" depends on !BR2_arc help This option enables the simulator support in the cross gdb. choice prompt "GDB debugger Version" depends on !BR2_arc depends on !BR2_microblaze default BR2_GDB_VERSION_7_10 help Select the version of gdb you wish to use. config BR2_GDB_VERSION_7_9 bool "gdb 7.9.x" config BR2_GDB_VERSION_7_10 bool "gdb 7.10.x" config BR2_GDB_VERSION_7_11 bool "gdb 7.11.x" endchoice endif # If cross-gdb is not enabled, the latest working version is chosen. config BR2_GDB_VERSION string depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB default "arc-2016.03-gdb" if BR2_arc default "6be65fb56ea6694a9260733a536a023a1e2d4d57" if BR2_microblaze default "7.9.1" if BR2_GDB_VERSION_7_9 default "7.10.1" if BR2_GDB_VERSION_7_10 || !BR2_PACKAGE_HOST_GDB default "7.11.1" if BR2_GDB_VERSION_7_11
shibajee/buildroot
package/gdb/Config.in.host
host
mit
1,661
#!/bin/sh # This shell script is used to fake Python. Gdb wants to be passed a # Python interpreter, to run its own python-config.py program, which # uses sysconfig. However, when cross-compiling, this doesn't work # well since we would have to use the host Python, whose sysconfig # module would return host values. # # As recommended at # https://sourceware.org/gdb/wiki/CrossCompilingWithPythonSupport, # this wrapper shell script can be used as a replacement. It ignores # the python-config.py script passed as first arguments, and # "emulates" its behavior. if [ $# -ne 2 ] ; then echo "Bad # args." >&2 exit 1 fi # The first argument is the path to python-config.py, ignore it. case "$2" in --includes) echo "-I${STAGING_DIR}/usr/include/python2.7" ;; --ldflags) echo "-lpthread -ldl -lutil -lm -lpython2.7" ;; --exec-prefix) echo "/usr" ;; *) echo "Bad arg $2." >&2 exit 1 ;; esac
shibajee/buildroot
package/gdb/gdb-python-config
none
mit
925
# From ftp://gcc.gnu.org/pub/gdb/releases/sha512.sum sha512 eebdf88b24e52e792b8a4b89ea85790de72b462a7810b44975fdf4232c068f353b15506071f450102a9d4bcecdde8e93dc3748a10699b7f73f3e04fb2d9d8414 gdb-7.9.1.tar.xz sha512 17a5138277a31685a5c2a841cb47ed9bc4626ea617b8ca77750513b300299f4fbbffe504958b5372de610dcb952c679cf8fa9c1bdadd380294fbf59b6e366010 gdb-7.10.1.tar.xz sha512 f80ec6c8a0f0b54c8b945666e875809174402b7e121efb378ebac931a91f9a1cc0048568f8e2f42ae8ae2392ff8d144c2e51d41c7398935017450aaf29838360 gdb-7.11.1.tar.xz # Locally calculated (fetched from Github) sha512 0a467091d4b01fbecabb4b8da1cb743025c70e7f4874a0b5c8fa2ec623569a39bde6762b91806de0be6e63711aeb6909715cfbe43860de73d8aec6159a9f10a7 gdb-6be65fb56ea6694a9260733a536a023a1e2d4d57.tar.gz sha512 1abef1357896c2b57cfa7f7414eedc49d0de26b54321c680c2d027b1a27ec453d421e7f89a5281336047542379fd4820685802059efbd32b87c5ccffbaf2bd16 gdb-arc-2016.03-gdb.tar.gz
shibajee/buildroot
package/gdb/gdb.hash
hash
mit
912
################################################################################ # # gdb # ################################################################################ GDB_VERSION = $(call qstrip,$(BR2_GDB_VERSION)) GDB_SITE = $(BR2_GNU_MIRROR)/gdb GDB_SOURCE = gdb-$(GDB_VERSION).tar.xz ifeq ($(BR2_arc),y) GDB_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(GDB_VERSION)) GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz GDB_FROM_GIT = y endif ifeq ($(BR2_microblaze),y) GDB_SITE = $(call github,Xilinx,gdb,$(GDB_VERSION)) GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz GDB_FROM_GIT = y endif GDB_LICENSE = GPLv2+, LGPLv2+, GPLv3+, LGPLv3+ GDB_LICENSE_FILES = COPYING COPYING.LIB COPYING3 COPYING3.LIB # We only want gdbserver and not the entire debugger. ifeq ($(BR2_PACKAGE_GDB_DEBUGGER),) GDB_SUBDIR = gdb/gdbserver HOST_GDB_SUBDIR = . else GDB_DEPENDENCIES = ncurses \ $(if $(BR2_PACKAGE_LIBICONV),libiconv) endif # For the host variant, we really want to build with XML support, # which is needed to read XML descriptions of target architectures. We # also need ncurses. HOST_GDB_DEPENDENCIES = host-expat host-ncurses # Starting with gdb 7.10, gdb wants to re-generate its documentation. # We were trying to avoid that by patching the Makefiles, but it wasn't # working in all situations. So, we simply add a dependency on # host-texinfo in all case. GDB_DEPENDENCIES += host-texinfo HOST_GDB_DEPENDENCIES += host-texinfo # Apply the Xtensa specific patches XTENSA_CORE_NAME = $(call qstrip, $(BR2_XTENSA_CORE_NAME)) ifneq ($(XTENSA_CORE_NAME),) define GDB_XTENSA_PRE_PATCH tar xf $(BR2_XTENSA_OVERLAY_DIR)/xtensa_$(XTENSA_CORE_NAME).tar \ -C $(@D) --strip-components=1 gdb endef GDB_PRE_PATCH_HOOKS += GDB_XTENSA_PRE_PATCH HOST_GDB_PRE_PATCH_HOOKS += GDB_XTENSA_PRE_PATCH endif ifeq ($(GDB_FROM_GIT),y) GDB_DEPENDENCIES += host-flex host-bison HOST_GDB_DEPENDENCIES += host-flex host-bison endif # When gdb sources are fetched from the binutils-gdb repository, they # also contain the binutils sources, but binutils shouldn't be built, # so we disable it. GDB_DISABLE_BINUTILS_CONF_OPTS = \ --disable-binutils \ --disable-ld \ --disable-gas # Starting with gdb 7.11, the bundled gnulib tries to use # rpl_gettimeofday (gettimeofday replacement) due to the code being # unable to determine if the replacement function should be used or # not when cross-compiling with uClibc or musl as C libraries. So use # gl_cv_func_gettimeofday_clobber=no to not use rpl_gettimeofday, # assuming musl and uClibc have a properly working gettimeofday # implementation. GDB_CONF_ENV = \ ac_cv_type_uintptr_t=yes \ gt_cv_func_gettext_libintl=yes \ ac_cv_func_dcgettext=yes \ gdb_cv_func_sigsetjmp=yes \ bash_cv_func_strcoll_broken=no \ bash_cv_must_reinstall_sighandlers=no \ bash_cv_func_sigsetjmp=present \ bash_cv_have_mbstate_t=yes \ gdb_cv_func_sigsetjmp=yes \ gl_cv_func_gettimeofday_clobber=no # The shared only build is not supported by gdb, so enable static build for # build-in libraries with --enable-static. GDB_CONF_OPTS = \ --without-uiout \ --disable-gdbtk \ --without-x \ --disable-sim \ $(GDB_DISABLE_BINUTILS_CONF_OPTS) \ $(if $(BR2_PACKAGE_GDB_SERVER),--enable-gdbserver) \ --with-curses \ --without-included-gettext \ --disable-werror \ --enable-static ifeq ($(BR2_PACKAGE_GDB_TUI),y) GDB_CONF_OPTS += --enable-tui else GDB_CONF_OPTS += --disable-tui endif ifeq ($(BR2_PACKAGE_GDB_PYTHON),y) GDB_CONF_OPTS += --with-python=$(TOPDIR)/package/gdb/gdb-python-config GDB_DEPENDENCIES += python else GDB_CONF_OPTS += --without-python endif ifeq ($(BR2_PACKAGE_EXPAT),y) GDB_CONF_OPTS += --with-expat GDB_CONF_OPTS += --with-libexpat-prefix=$(STAGING_DIR)/usr GDB_DEPENDENCIES += expat else GDB_CONF_OPTS += --without-expat endif ifeq ($(BR2_PACKAGE_XZ),y) GDB_CONF_OPTS += --with-lzma GDB_CONF_OPTS += --with-liblzma-prefix=$(STAGING_DIR)/usr GDB_DEPENDENCIES += xz else GDB_CONF_OPTS += --without-lzma endif ifeq ($(BR2_PACKAGE_ZLIB),y) GDB_CONF_OPTS += --with-zlib GDB_DEPENDENCIES += zlib else GDB_CONF_OPTS += --without-zlib endif # This removes some unneeded Python scripts and XML target description # files that are not useful for a normal usage of the debugger. define GDB_REMOVE_UNNEEDED_FILES $(RM) -rf $(TARGET_DIR)/usr/share/gdb endef GDB_POST_INSTALL_TARGET_HOOKS += GDB_REMOVE_UNNEEDED_FILES # This installs the gdbserver somewhere into the $(HOST_DIR) so that # it becomes an integral part of the SDK, if the toolchain generated # by Buildroot is later used as an external toolchain. We install it # in debug-root/usr/bin/gdbserver so that it matches what Crosstool-NG # does. define GDB_SDK_INSTALL_GDBSERVER $(INSTALL) -D -m 0755 $(TARGET_DIR)/usr/bin/gdbserver \ $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/debug-root/usr/bin/gdbserver endef ifeq ($(BR2_PACKAGE_GDB_SERVER),y) GDB_POST_INSTALL_TARGET_HOOKS += GDB_SDK_INSTALL_GDBSERVER endif # A few notes: # * --target, because we're doing a cross build rather than a real # host build. # * --enable-static because gdb really wants to use libbfd.a HOST_GDB_CONF_OPTS = \ --target=$(GNU_TARGET_NAME) \ --enable-static \ --without-uiout \ --disable-gdbtk \ --without-x \ --enable-threads \ --disable-werror \ --without-included-gettext \ $(GDB_DISABLE_BINUTILS_CONF_OPTS) ifeq ($(BR2_PACKAGE_HOST_GDB_TUI),y) HOST_GDB_CONF_OPTS += --enable-tui else HOST_GDB_CONF_OPTS += --disable-tui endif ifeq ($(BR2_PACKAGE_HOST_GDB_PYTHON),y) HOST_GDB_CONF_OPTS += --with-python=$(HOST_DIR)/usr/bin/python2 HOST_GDB_DEPENDENCIES += host-python else HOST_GDB_CONF_OPTS += --without-python endif # workaround a bug if in-tree build is used for bfin sim define HOST_GDB_BFIN_SIM_WORKAROUND $(RM) $(@D)/sim/common/tconfig.h endef ifeq ($(BR2_PACKAGE_HOST_GDB_SIM),y) HOST_GDB_CONF_OPTS += --enable-sim ifeq ($(BR2_bfin),y) HOST_GDB_PRE_CONFIGURE_HOOKS += HOST_GDB_BFIN_SIM_WORKAROUND endif else HOST_GDB_CONF_OPTS += --disable-sim endif # legacy $arch-linux-gdb symlink define HOST_GDB_ADD_SYMLINK cd $(HOST_DIR)/usr/bin && \ ln -snf $(GNU_TARGET_NAME)-gdb $(ARCH)-linux-gdb endef HOST_GDB_POST_INSTALL_HOOKS += HOST_GDB_ADD_SYMLINK HOST_GDB_POST_INSTALL_HOOKS += gen_gdbinit_file $(eval $(autotools-package)) $(eval $(host-autotools-package))
shibajee/buildroot
package/gdb/gdb.mk
mk
mit
6,282
config BR2_PACKAGE_GDBM bool "gdbm" help GNU dbm is a set of database routines that use extensible hashing. It works similar to the standard UNIX dbm routines. http://www.gnu.org/software/gdbm/gdbm.html
shibajee/buildroot
package/gdbm/Config.in
in
mit
215
# From http://lists.gnu.org/archive/html/info-gnu/2016-05/msg00009.html md5 9ce96ff4c99e74295ea19040931c8fb9 gdbm-1.12.tar.gz sha1 86513e8871bb376bc014e9e5a2d18a8e0a8ea2f5 gdbm-1.12.tar.gz
shibajee/buildroot
package/gdbm/gdbm.hash
hash
mit
189
################################################################################ # # gdbm # ################################################################################ GDBM_VERSION = 1.12 GDBM_SITE = $(BR2_GNU_MIRROR)/gdbm GDBM_LICENSE = GPLv3+ GDBM_LICENSE_FILES = COPYING GDBM_INSTALL_STAGING = YES ifeq ($(BR2_PACKAGE_GETTEXT),y) GDBM_DEPENDENCIES += gettext endif $(eval $(autotools-package))
shibajee/buildroot
package/gdbm/gdbm.mk
mk
mit
405
config BR2_PACKAGE_GDK_PIXBUF bool "gdk-pixbuf" depends on BR2_USE_WCHAR # glib2 depends on BR2_TOOLCHAIN_HAS_THREADS # glib2 depends on BR2_USE_MMU # glib2 select BR2_PACKAGE_LIBGLIB2 select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE help Gdk-Pixbuf is an image loader and scaler. It uses GObject and the GLib, to integrate well with GNOME applications. http://www.gtk.org/ comment "gdk-pixbuf needs a toolchain w/ wchar, threads" depends on BR2_USE_MMU depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
shibajee/buildroot
package/gdk-pixbuf/Config.in
in
mit
531
# From http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.34/gdk-pixbuf-2.34.0.sha256sum sha256 d55e5b383ee219bd0e23bf6ed4427d56a7db5379729a6e3e0a0e0eba9a8d8879 gdk-pixbuf-2.34.0.tar.xz
shibajee/buildroot
package/gdk-pixbuf/gdk-pixbuf.hash
hash
mit
187
################################################################################ # # gdk-pixbuf # ################################################################################ GDK_PIXBUF_VERSION_MAJOR = 2.34 GDK_PIXBUF_VERSION = $(GDK_PIXBUF_VERSION_MAJOR).0 GDK_PIXBUF_SOURCE = gdk-pixbuf-$(GDK_PIXBUF_VERSION).tar.xz GDK_PIXBUF_SITE = http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/$(GDK_PIXBUF_VERSION_MAJOR) GDK_PIXBUF_LICENSE = LGPLv2+ GDK_PIXBUF_LICENSE_FILES = COPYING GDK_PIXBUF_INSTALL_STAGING = YES GDK_PIXBUF_DEPENDENCIES = \ host-gdk-pixbuf host-libglib2 host-pkgconf \ libglib2 $(if $(BR2_ENABLE_LOCALE),,libiconv) HOST_GDK_PIXBUF_DEPENDENCIES = host-libpng host-pkgconf host-libglib2 GDK_PIXBUF_CONF_ENV = \ ac_cv_path_GLIB_GENMARSHAL=$(LIBGLIB2_HOST_BINARY) \ gio_can_sniff=no GDK_PIXBUF_CONF_OPTS = --disable-glibtest ifneq ($(BR2_PACKAGE_LIBPNG),y) GDK_PIXBUF_CONF_OPTS += --without-libpng else GDK_PIXBUF_DEPENDENCIES += libpng endif ifneq ($(BR2_PACKAGE_JPEG),y) HOST_GDK_PIXBUF_CONF_OPTS += --without-libjpeg GDK_PIXBUF_CONF_OPTS += --without-libjpeg else GDK_PIXBUF_DEPENDENCIES += jpeg HOST_GDK_PIXBUF_DEPENDENCIES += host-libjpeg endif ifneq ($(BR2_PACKAGE_TIFF),y) GDK_PIXBUF_CONF_OPTS += --without-libtiff HOST_GDK_PIXBUF_CONF_OPTS += --without-libtiff else GDK_PIXBUF_DEPENDENCIES += tiff GDK_PIXBUF_CONF_ENV += \ LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs libtiff-4`" HOST_GDK_PIXBUF_DEPENDENCIES += host-tiff endif ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y) GDK_PIXBUF_CONF_OPTS += --with-x11 GDK_PIXBUF_DEPENDENCIES += xlib_libX11 endif # gdk-pixbuf requires the loaders.cache file populated to work properly # Rather than doing so at runtime, since the fs can be read-only, do so # here after building and installing to target. # And since the cache file will contain absolute host directory names we # need to sanitize (strip) them. ifeq ($(BR2_STATIC_LIBS),) define GDK_PIXBUF_UPDATE_CACHE GDK_PIXBUF_MODULEDIR=$(HOST_DIR)/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders \ $(HOST_DIR)/usr/bin/gdk-pixbuf-query-loaders \ > $(TARGET_DIR)/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache $(SED) "s,$(HOST_DIR),,g" \ $(TARGET_DIR)/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache endef GDK_PIXBUF_POST_INSTALL_TARGET_HOOKS += GDK_PIXBUF_UPDATE_CACHE endif # Tests don't build correctly with uClibc define GDK_PIXBUF_DISABLE_TESTS $(SED) 's/ tests//' $(@D)/Makefile.in endef GDK_PIXBUF_POST_PATCH_HOOKS += GDK_PIXBUF_DISABLE_TESTS $(eval $(autotools-package)) $(eval $(host-autotools-package))
shibajee/buildroot
package/gdk-pixbuf/gdk-pixbuf.mk
mk
mit
2,521
[PATCH] update genext2fs.c to CVS rev 1.118 See http://genext2fs.cvs.sourceforge.net/viewvc/genext2fs/genext2fs/genext2fs.c?view=log for details. Numerous bugfixes, large file and filesystem support, rev 1 filesystems, volume id support, block size, .. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> --- cache.h | 128 ++++ genext2fs.c | 1870 ++++++++++++++++++++++++++++++++++++++++++------------------ list.h | 78 ++ 3 files changed, 1527 insertions(+), 549 deletions(-) Index: genext2fs-1.4.1/genext2fs.c =================================================================== --- genext2fs-1.4.1.orig/genext2fs.c +++ genext2fs-1.4.1/genext2fs.c @@ -53,6 +53,12 @@ // along with -q, -P, -U +/* + * Allow fseeko/off_t to be 64-bit offsets to allow filesystems and + * individual files >2GB. + */ +#define _FILE_OFFSET_BITS 64 + #include <config.h> #include <stdio.h> @@ -107,10 +113,8 @@ #if HAVE_DIRENT_H # include <dirent.h> -# define NAMLEN(dirent) strlen((dirent)->d_name) #else # define dirent direct -# define NAMLEN(dirent) (dirent)->d_namlen # if HAVE_SYS_NDIR_H # include <sys/ndir.h> # endif @@ -144,6 +148,8 @@ # include <limits.h> #endif +#include "cache.h" + struct stats { unsigned long nblocks; unsigned long ninodes; @@ -151,13 +157,42 @@ // block size -#define BLOCKSIZE 1024 +static int blocksize = 1024; + +#define SUPERBLOCK_OFFSET 1024 +#define SUPERBLOCK_SIZE 1024 + +#define BLOCKSIZE blocksize #define BLOCKS_PER_GROUP 8192 #define INODES_PER_GROUP 8192 /* Percentage of blocks that are reserved.*/ #define RESERVED_BLOCKS 5/100 #define MAX_RESERVED_BLOCKS 25/100 +/* The default value for s_creator_os. */ +#if defined(__linux__) && defined(EXT2_OS_LINUX) +#define CREATOR_OS EXT2_OS_LINUX +#define CREATOR_OS_NAME "linux" +#else +#if defined(__GNU__) && defined(EXT2_OS_HURD) +#define CREATOR_OS EXT2_OS_HURD +#define CREATOR_OS_NAME "hurd" +#else +#if defined(__FreeBSD__) && defined(EXT2_OS_FREEBSD) +#define CREATOR_OS EXT2_OS_FREEBSD +#define CREATOR_OS_NAME "freebsd" +#else +#if defined(LITES) && defined(EXT2_OS_LITES) +#define CREATOR_OS EXT2_OS_LITES +#define CREATOR_OS_NAME "lites" +#else +#define CREATOR_OS EXT2_OS_LINUX /* by default */ +#define CREATOR_OS_NAME "linux" +#endif /* defined(LITES) && defined(EXT2_OS_LITES) */ +#endif /* defined(__FreeBSD__) && defined(EXT2_OS_FREEBSD) */ +#endif /* defined(__GNU__) && defined(EXT2_OS_HURD) */ +#endif /* defined(__linux__) && defined(EXT2_OS_LINUX) */ + // inode block size (why is it != BLOCKSIZE ?!?) /* The field i_blocks in the ext2 inode stores the number of data blocks @@ -190,6 +225,14 @@ #define EXT2_TIND_BLOCK 14 // triple indirect block #define EXT2_INIT_BLOCK 0xFFFFFFFF // just initialized (not really a block address) +// codes for operating systems + +#define EXT2_OS_LINUX 0 +#define EXT2_OS_HURD 1 +#define EXT2_OS_MASIX 2 +#define EXT2_OS_FREEBSD 3 +#define EXT2_OS_LITES 4 + // end of a block walk #define WALK_END 0xFFFFFFFE @@ -227,44 +270,46 @@ #define FM_IWOTH 0000002 // write #define FM_IXOTH 0000001 // execute -// options - -#define OP_HOLES 0x01 // make files with holes - /* Defines for accessing group details */ // Number of groups in the filesystem #define GRP_NBGROUPS(fs) \ - (((fs)->sb.s_blocks_count - fs->sb.s_first_data_block + \ - (fs)->sb.s_blocks_per_group - 1) / (fs)->sb.s_blocks_per_group) + (((fs)->sb->s_blocks_count - fs->sb->s_first_data_block + \ + (fs)->sb->s_blocks_per_group - 1) / (fs)->sb->s_blocks_per_group) // Get group block bitmap (bbm) given the group number -#define GRP_GET_GROUP_BBM(fs,grp) ( get_blk((fs),(fs)->gd[(grp)].bg_block_bitmap) ) +#define GRP_GET_GROUP_BBM(fs,grp,bi) (get_blk((fs),(grp)->bg_block_bitmap,(bi))) +#define GRP_PUT_GROUP_BBM(bi) ( put_blk((bi)) ) // Get group inode bitmap (ibm) given the group number -#define GRP_GET_GROUP_IBM(fs,grp) ( get_blk((fs),(fs)->gd[(grp)].bg_inode_bitmap) ) - +#define GRP_GET_GROUP_IBM(fs,grp,bi) (get_blk((fs), (grp)->bg_inode_bitmap,(bi))) +#define GRP_PUT_GROUP_IBM(bi) ( put_blk((bi)) ) + // Given an inode number find the group it belongs to -#define GRP_GROUP_OF_INODE(fs,nod) ( ((nod)-1) / (fs)->sb.s_inodes_per_group) +#define GRP_GROUP_OF_INODE(fs,nod) ( ((nod)-1) / (fs)->sb->s_inodes_per_group) //Given an inode number get the inode bitmap that covers it -#define GRP_GET_INODE_BITMAP(fs,nod) \ - ( GRP_GET_GROUP_IBM((fs),GRP_GROUP_OF_INODE((fs),(nod))) ) +#define GRP_GET_INODE_BITMAP(fs,nod,bi,gi) \ + ( GRP_GET_GROUP_IBM((fs),get_gd(fs,GRP_GROUP_OF_INODE((fs),(nod)),gi),bi) ) +#define GRP_PUT_INODE_BITMAP(bi,gi) \ + ( GRP_PUT_GROUP_IBM((bi)),put_gd((gi)) ) //Given an inode number find its offset within the inode bitmap that covers it #define GRP_IBM_OFFSET(fs,nod) \ - ( (nod) - GRP_GROUP_OF_INODE((fs),(nod))*(fs)->sb.s_inodes_per_group ) + ( (nod) - GRP_GROUP_OF_INODE((fs),(nod))*(fs)->sb->s_inodes_per_group ) // Given a block number find the group it belongs to -#define GRP_GROUP_OF_BLOCK(fs,blk) ( ((blk)-1) / (fs)->sb.s_blocks_per_group) +#define GRP_GROUP_OF_BLOCK(fs,blk) ( ((blk)-1) / (fs)->sb->s_blocks_per_group) -//Given a block number get the block bitmap that covers it -#define GRP_GET_BLOCK_BITMAP(fs,blk) \ - ( GRP_GET_GROUP_BBM((fs),GRP_GROUP_OF_BLOCK((fs),(blk))) ) +//Given a block number get/put the block bitmap that covers it +#define GRP_GET_BLOCK_BITMAP(fs,blk,bi,gi) \ + ( GRP_GET_GROUP_BBM((fs),get_gd(fs,GRP_GROUP_OF_BLOCK((fs),(blk)),(gi)),(bi)) ) +#define GRP_PUT_BLOCK_BITMAP(bi,gi) \ + ( GRP_PUT_GROUP_BBM((bi)),put_gd((gi)) ) //Given a block number find its offset within the block bitmap that covers it #define GRP_BBM_OFFSET(fs,blk) \ - ( (blk) - GRP_GROUP_OF_BLOCK((fs),(blk))*(fs)->sb.s_blocks_per_group ) + ( (blk) - GRP_GROUP_OF_BLOCK((fs),(blk))*(fs)->sb->s_blocks_per_group ) // used types @@ -286,7 +331,9 @@ // older solaris. Note that this is still not very portable, in that // the return value cannot be trusted. -#if SCANF_CAN_MALLOC +#if 0 // SCANF_CAN_MALLOC +// C99 define "a" for floating point, so you can have runtime surprise +// according the library versions # define SCANF_PREFIX "a" # define SCANF_STRING(s) (&s) #else @@ -430,6 +477,17 @@ ((val<<8)&0xFF0000) | (val<<24)); } +static inline int +is_blk_empty(uint8 *b) +{ + uint32 i; + uint32 *v = (uint32 *) b; + + for(i = 0; i < BLOCKSIZE / 4; i++) + if (*v++) + return 0; + return 1; +} // on-disk structures // this trick makes me declare things only once @@ -460,7 +518,22 @@ udecl32(s_creator_os) /* Indicator of which OS created the filesystem */ \ udecl32(s_rev_level) /* The revision level of the filesystem */ \ udecl16(s_def_resuid) /* The default uid for reserved blocks */ \ - udecl16(s_def_resgid) /* The default gid for reserved blocks */ + udecl16(s_def_resgid) /* The default gid for reserved blocks */ \ + /* rev 1 version fields start here */ \ + udecl32(s_first_ino) /* First non-reserved inode */ \ + udecl16(s_inode_size) /* size of inode structure */ \ + udecl16(s_block_group_nr) /* block group # of this superblock */ \ + udecl32(s_feature_compat) /* compatible feature set */ \ + udecl32(s_feature_incompat) /* incompatible feature set */ \ + udecl32(s_feature_ro_compat) /* readonly-compatible feature set */ \ + utdecl8(s_uuid,16) /* 128-bit uuid for volume */ \ + utdecl8(s_volume_name,16) /* volume name */ \ + utdecl8(s_last_mounted,64) /* directory where last mounted */ \ + udecl32(s_algorithm_usage_bitmap) /* For compression */ + +#define EXT2_GOOD_OLD_FIRST_INO 11 +#define EXT2_GOOD_OLD_INODE_SIZE 128 +#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 #define groupdescriptor_decl \ udecl32(bg_block_bitmap) /* Block number of the block bitmap */ \ @@ -500,6 +573,7 @@ #define decl8(x) int8 x; #define udecl8(x) uint8 x; +#define utdecl8(x,n) uint8 x[n]; #define decl16(x) int16 x; #define udecl16(x) uint16 x; #define decl32(x) int32 x; @@ -509,7 +583,7 @@ typedef struct { superblock_decl - uint32 s_reserved[235]; // Reserved + uint32 s_reserved[205]; // Reserved } superblock; typedef struct @@ -527,10 +601,9 @@ typedef struct { directory_decl - char d_name[0]; } directory; -typedef uint8 block[BLOCKSIZE]; +typedef uint8 *block; /* blockwalker fields: The blockwalker is used to access all the blocks of a file (including @@ -567,23 +640,41 @@ uint32 bptind; } blockwalker; +#define HDLINK_CNT 16 +struct hdlink_s +{ + uint32 src_inode; + uint32 dst_nod; +}; + +struct hdlinks_s +{ + int32 count; + struct hdlink_s *hdl; +}; /* Filesystem structure that support groups */ -#if BLOCKSIZE == 1024 typedef struct { - block zero; // The famous block 0 - superblock sb; // The superblock - groupdescriptor gd[0]; // The group descriptors + FILE *f; + superblock *sb; + int swapit; + int32 hdlink_cnt; + struct hdlinks_s hdlinks; + + int holes; + + listcache blks; + listcache gds; + listcache inodes; + listcache blkmaps; } filesystem; -#else -#error UNHANDLED BLOCKSIZE -#endif // now the endianness swap #undef decl8 #undef udecl8 +#undef utdecl8 #undef decl16 #undef udecl16 #undef decl32 @@ -592,28 +683,13 @@ #define decl8(x) #define udecl8(x) +#define utdecl8(x,n) #define decl16(x) this->x = swab16(this->x); #define udecl16(x) this->x = swab16(this->x); #define decl32(x) this->x = swab32(this->x); #define udecl32(x) this->x = swab32(this->x); #define utdecl32(x,n) { int i; for(i=0; i<n; i++) this->x[i] = swab32(this->x[i]); } -#define HDLINK_CNT 16 -static int32 hdlink_cnt = HDLINK_CNT; -struct hdlink_s -{ - uint32 src_inode; - uint32 dst_nod; -}; - -struct hdlinks_s -{ - int32 count; - struct hdlink_s *hdl; -}; - -static struct hdlinks_s hdlinks; - static void swap_sb(superblock *sb) { @@ -633,9 +709,24 @@ static void swap_nod(inode *nod) { + uint32 nblk; + #define this nod inode_decl #undef this + + // block and character inodes store the major and minor in the + // i_block, so we need to unswap to get those. Also, if it's + // zero iblocks, put the data back like it belongs. + nblk = nod->i_blocks / INOBLK; + if ((nod->i_size && !nblk) + || ((nod->i_mode & FM_IFBLK) == FM_IFBLK) + || ((nod->i_mode & FM_IFCHR) == FM_IFCHR)) + { + int i; + for(i = 0; i <= EXT2_TIND_BLOCK; i++) + nod->i_block[i] = swab32(nod->i_block[i]); + } } static void @@ -657,6 +748,7 @@ #undef decl8 #undef udecl8 +#undef utdecl8 #undef decl16 #undef udecl16 #undef decl32 @@ -770,15 +862,15 @@ } int -is_hardlink(ino_t inode) +is_hardlink(filesystem *fs, ino_t inode) { int i; - for(i = 0; i < hdlinks.count; i++) { - if(hdlinks.hdl[i].src_inode == inode) + for(i = 0; i < fs->hdlinks.count; i++) { + if(fs->hdlinks.hdl[i].src_inode == inode) return i; } - return -1; + return -1; } // printf helper macro @@ -789,6 +881,8 @@ get_workblk(void) { unsigned char* b=calloc(1,BLOCKSIZE); + if (!b) + error_msg_and_die("get_workblk() failed, out of memory"); return b; } static inline void @@ -811,24 +905,464 @@ return b[(item-1) / 8] & (1 << ((item-1) % 8)); } -// return a given block from a filesystem +// Used by get_blk/put_blk to hold information about a block owned +// by the user. +typedef struct +{ + cache_link link; + + filesystem *fs; + uint32 blk; + uint8 *b; + uint32 usecount; +} blk_info; + +#define MAX_FREE_CACHE_BLOCKS 100 + +static uint32 +blk_elem_val(cache_link *elem) +{ + blk_info *bi = container_of(elem, blk_info, link); + return bi->blk; +} + +static void +blk_freed(cache_link *elem) +{ + blk_info *bi = container_of(elem, blk_info, link); + + if (fseeko(bi->fs->f, ((off_t) bi->blk) * BLOCKSIZE, SEEK_SET)) + perror_msg_and_die("fseek"); + if (fwrite(bi->b, BLOCKSIZE, 1, bi->fs->f) != 1) + perror_msg_and_die("get_blk: write"); + free(bi->b); + free(bi); +} + +// Return a given block from a filesystem. Make sure to call +// put_blk when you are done with it. static inline uint8 * -get_blk(filesystem *fs, uint32 blk) +get_blk(filesystem *fs, uint32 blk, blk_info **rbi) { - return (uint8*)fs + blk*BLOCKSIZE; + cache_link *curr; + blk_info *bi; + + if (blk >= fs->sb->s_blocks_count) + error_msg_and_die("Internal error, block out of range"); + + curr = cache_find(&fs->blks, blk); + if (curr) { + bi = container_of(curr, blk_info, link); + bi->usecount++; + goto out; + } + + bi = malloc(sizeof(*bi)); + if (!bi) + error_msg_and_die("get_blk: out of memory"); + bi->fs = fs; + bi->blk = blk; + bi->usecount = 1; + bi->b = malloc(BLOCKSIZE); + if (!bi->b) + error_msg_and_die("get_blk: out of memory"); + cache_add(&fs->blks, &bi->link); + if (fseeko(fs->f, ((off_t) blk) * BLOCKSIZE, SEEK_SET)) + perror_msg_and_die("fseek"); + if (fread(bi->b, BLOCKSIZE, 1, fs->f) != 1) { + if (ferror(fs->f)) + perror_msg_and_die("fread"); + memset(bi->b, 0, BLOCKSIZE); + } + +out: + *rbi = bi; + return bi->b; } // return a given inode from a filesystem -static inline inode * -get_nod(filesystem *fs, uint32 nod) +static inline void +put_blk(blk_info *bi) +{ + if (bi->usecount == 0) + error_msg_and_die("Internal error: put_blk usecount zero"); + bi->usecount--; + if (bi->usecount == 0) + /* Free happens in the cache code */ + cache_item_set_unused(&bi->fs->blks, &bi->link); +} + +typedef struct { - int grp,offset; + cache_link link; + + filesystem *fs; + int gds; + blk_info *bi; + groupdescriptor *gd; + uint32 usecount; +} gd_info; + +#define MAX_FREE_CACHE_GDS 100 + +static uint32 +gd_elem_val(cache_link *elem) +{ + gd_info *gi = container_of(elem, gd_info, link); + return gi->gds; +} + +static void +gd_freed(cache_link *elem) +{ + gd_info *gi = container_of(elem, gd_info, link); + + if (gi->fs->swapit) + swap_gd(gi->gd); + put_blk(gi->bi); + free(gi); +} + +#define GDS_START ((SUPERBLOCK_OFFSET + SUPERBLOCK_SIZE + BLOCKSIZE - 1) / BLOCKSIZE) +#define GDS_PER_BLOCK (BLOCKSIZE / sizeof(groupdescriptor)) +// the group descriptors are aligned on the block size +static inline groupdescriptor * +get_gd(filesystem *fs, uint32 no, gd_info **rgi) +{ + uint32 gdblk; + uint32 offset; + gd_info *gi; + cache_link *curr; + + curr = cache_find(&fs->gds, no); + if (curr) { + gi = container_of(curr, gd_info, link); + gi->usecount++; + goto out; + } + + gi = malloc(sizeof(*gi)); + if (!gi) + error_msg_and_die("get_gd: out of memory"); + gi->fs = fs; + gi->gds = no; + gi->usecount = 1; + gdblk = GDS_START + (no / GDS_PER_BLOCK); + offset = no % GDS_PER_BLOCK; + gi->gd = ((groupdescriptor *) get_blk(fs, gdblk, &gi->bi)) + offset; + cache_add(&fs->gds, &gi->link); + if (fs->swapit) + swap_gd(gi->gd); + out: + *rgi = gi; + + return gi->gd; +} + +static inline void +put_gd(gd_info *gi) +{ + if (gi->usecount == 0) + error_msg_and_die("Internal error: put_gd usecount zero"); + + gi->usecount--; + if (gi->usecount == 0) + /* Free happens in the cache code */ + cache_item_set_unused(&gi->fs->gds, &gi->link); +} + +// Used by get_blkmap/put_blkmap to hold information about an block map +// owned by the user. +typedef struct +{ + cache_link link; + + filesystem *fs; + uint32 blk; + uint8 *b; + blk_info *bi; + uint32 usecount; +} blkmap_info; + +#define MAX_FREE_CACHE_BLOCKMAPS 100 + +static uint32 +blkmap_elem_val(cache_link *elem) +{ + blkmap_info *bmi = container_of(elem, blkmap_info, link); + return bmi->blk; +} + +static void +blkmap_freed(cache_link *elem) +{ + blkmap_info *bmi = container_of(elem, blkmap_info, link); + + if (bmi->fs->swapit) + swap_block(bmi->b); + put_blk(bmi->bi); + free(bmi); +} + +// Return a given block map from a filesystem. Make sure to call +// put_blkmap when you are done with it. +static inline uint32 * +get_blkmap(filesystem *fs, uint32 blk, blkmap_info **rbmi) +{ + blkmap_info *bmi; + cache_link *curr; + + curr = cache_find(&fs->blkmaps, blk); + if (curr) { + bmi = container_of(curr, blkmap_info, link); + bmi->usecount++; + goto out; + } + + bmi = malloc(sizeof(*bmi)); + if (!bmi) + error_msg_and_die("get_blkmap: out of memory"); + bmi->fs = fs; + bmi->blk = blk; + bmi->b = get_blk(fs, blk, &bmi->bi); + bmi->usecount = 1; + cache_add(&fs->blkmaps, &bmi->link); + + if (fs->swapit) + swap_block(bmi->b); + out: + *rbmi = bmi; + return (uint32 *) bmi->b; +} + +static inline void +put_blkmap(blkmap_info *bmi) +{ + if (bmi->usecount == 0) + error_msg_and_die("Internal error: put_blkmap usecount zero"); + + bmi->usecount--; + if (bmi->usecount == 0) + /* Free happens in the cache code */ + cache_item_set_unused(&bmi->fs->blkmaps, &bmi->link); +} + +// Used by get_nod/put_nod to hold information about an inode owned +// by the user. +typedef struct +{ + cache_link link; + + filesystem *fs; + uint32 nod; + uint8 *b; + blk_info *bi; inode *itab; + uint32 usecount; +} nod_info; + +#define MAX_FREE_CACHE_INODES 100 + +static uint32 +inode_elem_val(cache_link *elem) +{ + nod_info *ni = container_of(elem, nod_info, link); + return ni->nod; +} + +static void +inode_freed(cache_link *elem) +{ + nod_info *ni = container_of(elem, nod_info, link); + + if (ni->fs->swapit) + swap_nod(ni->itab); + put_blk(ni->bi); + free(ni); +} + +#define INODES_PER_BLOCK (BLOCKSIZE / sizeof(inode)) - offset = GRP_IBM_OFFSET(fs,nod); +// return a given inode from a filesystem +static inline inode * +get_nod(filesystem *fs, uint32 nod, nod_info **rni) +{ + uint32 grp, boffset, offset; + cache_link *curr; + groupdescriptor *gd; + gd_info *gi; + nod_info *ni; + + curr = cache_find(&fs->inodes, nod); + if (curr) { + ni = container_of(curr, nod_info, link); + ni->usecount++; + goto out; + } + + ni = malloc(sizeof(*ni)); + if (!ni) + error_msg_and_die("get_nod: out of memory"); + ni->fs = fs; + ni->nod = nod; + ni->usecount = 1; + cache_add(&fs->inodes, &ni->link); + + offset = GRP_IBM_OFFSET(fs,nod) - 1; + boffset = offset / INODES_PER_BLOCK; + offset %= INODES_PER_BLOCK; grp = GRP_GROUP_OF_INODE(fs,nod); - itab = (inode *)get_blk(fs, fs->gd[grp].bg_inode_table); - return itab+offset-1; + gd = get_gd(fs, grp, &gi); + ni->b = get_blk(fs, gd->bg_inode_table + boffset, &ni->bi); + ni->itab = ((inode *) ni->b) + offset; + if (fs->swapit) + swap_nod(ni->itab); + put_gd(gi); + out: + *rni = ni; + return ni->itab; +} + +static inline void +put_nod(nod_info *ni) +{ + if (ni->usecount == 0) + error_msg_and_die("Internal error: put_nod usecount zero"); + + ni->usecount--; + if (ni->usecount == 0) + /* Free happens in the cache code */ + cache_item_set_unused(&ni->fs->inodes, &ni->link); +} + +// Used to hold state information while walking a directory inode. +typedef struct +{ + directory d; + filesystem *fs; + uint32 nod; + directory *last_d; + uint8 *b; + blk_info *bi; +} dirwalker; + +// Start a directory walk on the given inode. You must pass in a +// dirwalker structure, then use that dirwalker for future operations. +// Call put_dir when you are done walking the directory. +static inline directory * +get_dir(filesystem *fs, uint32 nod, dirwalker *dw) +{ + dw->fs = fs; + dw->b = get_blk(fs, nod, &dw->bi); + dw->nod = nod; + dw->last_d = (directory *) dw->b; + + memcpy(&dw->d, dw->last_d, sizeof(directory)); + if (fs->swapit) + swap_dir(&dw->d); + return &dw->d; +} + +// Move to the next directory. +static inline directory * +next_dir(dirwalker *dw) +{ + directory *next_d = (directory *)((int8*)dw->last_d + dw->d.d_rec_len); + + if (dw->fs->swapit) + swap_dir(&dw->d); + memcpy(dw->last_d, &dw->d, sizeof(directory)); + + if (((int8 *) next_d) >= ((int8 *) dw->b + BLOCKSIZE)) + return NULL; + + dw->last_d = next_d; + memcpy(&dw->d, next_d, sizeof(directory)); + if (dw->fs->swapit) + swap_dir(&dw->d); + return &dw->d; +} + +// Call then when you are done with the directory walk. +static inline void +put_dir(dirwalker *dw) +{ + if (dw->fs->swapit) + swap_dir(&dw->d); + memcpy(dw->last_d, &dw->d, sizeof(directory)); + + if (dw->nod == 0) + free_workblk(dw->b); + else + put_blk(dw->bi); +} + +// Create a new directory block with the given inode as it's destination +// and append it to the current dirwalker. +static directory * +new_dir(filesystem *fs, uint32 dnod, const char *name, int nlen, dirwalker *dw) +{ + directory *d; + + dw->fs = fs; + dw->b = get_workblk(); + dw->nod = 0; + dw->last_d = (directory *) dw->b; + d = &dw->d; + d->d_inode = dnod; + d->d_rec_len = BLOCKSIZE; + d->d_name_len = nlen; + strncpy(((char *) dw->last_d) + sizeof(directory), name, nlen); + return d; +} + +// Shrink the current directory entry, make a new one with the free +// space, and return the new directory entry (making it current). +static inline directory * +shrink_dir(dirwalker *dw, uint32 nod, const char *name, int nlen) +{ + int reclen, preclen; + directory *d = &dw->d; + + reclen = d->d_rec_len; + d->d_rec_len = sizeof(directory) + rndup(d->d_name_len, 4); + preclen = d->d_rec_len; + reclen -= preclen; + if (dw->fs->swapit) + swap_dir(&dw->d); + memcpy(dw->last_d, &dw->d, sizeof(directory)); + + dw->last_d = (directory *) (((int8 *) dw->last_d) + preclen); + d->d_rec_len = reclen; + d->d_inode = nod; + d->d_name_len = nlen; + strncpy(((char *) dw->last_d) + sizeof(directory), name, nlen); + + return d; +} + +// Return the current block the directory is walking +static inline uint8 * +dir_data(dirwalker *dw) +{ + return dw->b; +} + +// Return the pointer to the name for the current directory +static inline char * +dir_name(dirwalker *dw) +{ + return ((char *) dw->last_d) + sizeof(directory); +} + +// Set the name for the current directory. Note that this doesn't +// verify that there is space for the directory name, you must do +// that yourself. +static void +dir_set_name(dirwalker *dw, const char *name, int nlen) +{ + dw->d.d_name_len = nlen; + strncpy(((char *) dw->last_d) + sizeof(directory), name, nlen); } // allocate a given block/inode in the bitmap @@ -870,21 +1404,34 @@ { uint32 bk=0; uint32 grp,nbgroups; + blk_info *bi; + groupdescriptor *gd; + gd_info *gi; grp = GRP_GROUP_OF_INODE(fs,nod); nbgroups = GRP_NBGROUPS(fs); - if(!(bk = allocate(get_blk(fs,fs->gd[grp].bg_block_bitmap), 0))) { - for(grp=0;grp<nbgroups && !bk;grp++) - bk=allocate(get_blk(fs,fs->gd[grp].bg_block_bitmap),0); + gd = get_gd(fs, grp, &gi); + bk = allocate(GRP_GET_GROUP_BBM(fs, gd, &bi), 0); + GRP_PUT_GROUP_BBM(bi); + put_gd(gi); + if (!bk) { + for (grp=0; grp<nbgroups && !bk; grp++) { + gd = get_gd(fs, grp, &gi); + bk = allocate(GRP_GET_GROUP_BBM(fs, gd, &bi), 0); + GRP_PUT_GROUP_BBM(bi); + put_gd(gi); + } grp--; } if (!bk) error_msg_and_die("couldn't allocate a block (no free space)"); - if(!(fs->gd[grp].bg_free_blocks_count--)) + gd = get_gd(fs, grp, &gi); + if(!(gd->bg_free_blocks_count--)) error_msg_and_die("group descr %d. free blocks count == 0 (corrupted fs?)",grp); - if(!(fs->sb.s_free_blocks_count--)) + put_gd(gi); + if(!(fs->sb->s_free_blocks_count--)) error_msg_and_die("superblock free blocks count == 0 (corrupted fs?)"); - return fs->sb.s_blocks_per_group*grp + bk; + return fs->sb->s_first_data_block + fs->sb->s_blocks_per_group*grp + (bk-1); } // free a block @@ -892,12 +1439,18 @@ free_blk(filesystem *fs, uint32 bk) { uint32 grp; - - grp = bk / fs->sb.s_blocks_per_group; - bk %= fs->sb.s_blocks_per_group; - deallocate(get_blk(fs,fs->gd[grp].bg_block_bitmap), bk); - fs->gd[grp].bg_free_blocks_count++; - fs->sb.s_free_blocks_count++; + blk_info *bi; + gd_info *gi; + groupdescriptor *gd; + + grp = bk / fs->sb->s_blocks_per_group; + bk %= fs->sb->s_blocks_per_group; + gd = get_gd(fs, grp, &gi); + deallocate(GRP_GET_GROUP_BBM(fs, gd, &bi), bk); + GRP_PUT_GROUP_BBM(bi); + gd->bg_free_blocks_count++; + put_gd(gi); + fs->sb->s_free_blocks_count++; } // allocate an inode @@ -906,6 +1459,9 @@ { uint32 nod,best_group=0; uint32 grp,nbgroups,avefreei; + blk_info *bi; + gd_info *gi, *bestgi; + groupdescriptor *gd, *bestgd; nbgroups = GRP_NBGROUPS(fs); @@ -914,22 +1470,32 @@ /* find the one with the most free blocks and allocate node there */ /* Idea from find_group_dir in fs/ext2/ialloc.c in 2.4.19 kernel */ /* We do it for all inodes. */ - avefreei = fs->sb.s_free_inodes_count / nbgroups; + avefreei = fs->sb->s_free_inodes_count / nbgroups; + bestgd = get_gd(fs, best_group, &bestgi); for(grp=0; grp<nbgroups; grp++) { - if (fs->gd[grp].bg_free_inodes_count < avefreei || - fs->gd[grp].bg_free_inodes_count == 0) + gd = get_gd(fs, grp, &gi); + if (gd->bg_free_inodes_count < avefreei || + gd->bg_free_inodes_count == 0) { + put_gd(gi); continue; - if (!best_group || - fs->gd[grp].bg_free_blocks_count > fs->gd[best_group].bg_free_blocks_count) + } + if (!best_group || gd->bg_free_blocks_count > bestgd->bg_free_blocks_count) { + put_gd(bestgi); best_group = grp; + bestgd = gd; + bestgi = gi; + } else + put_gd(gi); } - if (!(nod = allocate(get_blk(fs,fs->gd[best_group].bg_inode_bitmap),0))) + if (!(nod = allocate(GRP_GET_GROUP_IBM(fs, bestgd, &bi), 0))) error_msg_and_die("couldn't allocate an inode (no free inode)"); - if(!(fs->gd[best_group].bg_free_inodes_count--)) + GRP_PUT_GROUP_IBM(bi); + if(!(bestgd->bg_free_inodes_count--)) error_msg_and_die("group descr. free blocks count == 0 (corrupted fs?)"); - if(!(fs->sb.s_free_inodes_count--)) + put_gd(bestgi); + if(!(fs->sb->s_free_inodes_count--)) error_msg_and_die("superblock free blocks count == 0 (corrupted fs?)"); - return fs->sb.s_inodes_per_group*best_group+nod; + return fs->sb->s_inodes_per_group*best_group+nod; } // print a bitmap allocation @@ -962,30 +1528,40 @@ // used after being freed, so once you start // freeing blocks don't stop until the end of // the file. moreover, i_blocks isn't updated. -// in fact, don't do that, just use extend_blk // if hole!=0, create a hole in the file static uint32 walk_bw(filesystem *fs, uint32 nod, blockwalker *bw, int32 *create, uint32 hole) { uint32 *bkref = 0; + uint32 bk = 0; + blkmap_info *bmi1 = NULL, *bmi2 = NULL, *bmi3 = NULL; uint32 *b; int extend = 0, reduce = 0; + inode *inod; + nod_info *ni; + uint32 *iblk; + if(create && (*create) < 0) reduce = 1; - if(bw->bnum >= get_nod(fs, nod)->i_blocks / INOBLK) + inod = get_nod(fs, nod, &ni); + if(bw->bnum >= inod->i_blocks / INOBLK) { if(create && (*create) > 0) { (*create)--; extend = 1; } - else + else + { + put_nod(ni); return WALK_END; + } } + iblk = inod->i_block; // first direct block if(bw->bpdir == EXT2_INIT_BLOCK) { - bkref = &get_nod(fs, nod)->i_block[bw->bpdir = 0]; + bkref = &iblk[bw->bpdir = 0]; if(extend) // allocate first block *bkref = hole ? 0 : alloc_blk(fs,nod); if(reduce) // free first block @@ -994,7 +1570,7 @@ // direct block else if(bw->bpdir < EXT2_NDIR_BLOCKS) { - bkref = &get_nod(fs, nod)->i_block[++bw->bpdir]; + bkref = &iblk[++bw->bpdir]; if(extend) // allocate block *bkref = hole ? 0 : alloc_blk(fs,nod); if(reduce) // free block @@ -1007,10 +1583,10 @@ bw->bpdir = EXT2_IND_BLOCK; bw->bpind = 0; if(extend) // allocate indirect block - get_nod(fs, nod)->i_block[bw->bpdir] = alloc_blk(fs,nod); + iblk[bw->bpdir] = alloc_blk(fs,nod); if(reduce) // free indirect block - free_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); - b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); + free_blk(fs, iblk[bw->bpdir]); + b = get_blkmap(fs, iblk[bw->bpdir], &bmi1); bkref = &b[bw->bpind]; if(extend) // allocate first block *bkref = hole ? 0 : alloc_blk(fs,nod); @@ -1021,7 +1597,7 @@ else if((bw->bpdir == EXT2_IND_BLOCK) && (bw->bpind < BLOCKSIZE/4 - 1)) { bw->bpind++; - b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); + b = get_blkmap(fs, iblk[bw->bpdir], &bmi1); bkref = &b[bw->bpind]; if(extend) // allocate block *bkref = hole ? 0 : alloc_blk(fs,nod); @@ -1036,15 +1612,15 @@ bw->bpind = 0; bw->bpdind = 0; if(extend) // allocate double indirect block - get_nod(fs, nod)->i_block[bw->bpdir] = alloc_blk(fs,nod); + iblk[bw->bpdir] = alloc_blk(fs,nod); if(reduce) // free double indirect block - free_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); - b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); + free_blk(fs, iblk[bw->bpdir]); + b = get_blkmap(fs, iblk[bw->bpdir], &bmi1); if(extend) // allocate first indirect block b[bw->bpind] = alloc_blk(fs,nod); if(reduce) // free firstindirect block free_blk(fs, b[bw->bpind]); - b = (uint32*)get_blk(fs, b[bw->bpind]); + b = get_blkmap(fs, b[bw->bpind], &bmi2); bkref = &b[bw->bpdind]; if(extend) // allocate first block *bkref = hole ? 0 : alloc_blk(fs,nod); @@ -1055,8 +1631,8 @@ else if((bw->bpdir == EXT2_DIND_BLOCK) && (bw->bpdind < BLOCKSIZE/4 - 1)) { bw->bpdind++; - b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); - b = (uint32*)get_blk(fs, b[bw->bpind]); + b = get_blkmap(fs, iblk[bw->bpdir], &bmi1); + b = get_blkmap(fs, b[bw->bpind], &bmi2); bkref = &b[bw->bpdind]; if(extend) // allocate block *bkref = hole ? 0 : alloc_blk(fs,nod); @@ -1069,12 +1645,12 @@ bw->bnum++; bw->bpdind = 0; bw->bpind++; - b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); + b = get_blkmap(fs, iblk[bw->bpdir], &bmi1); if(extend) // allocate indirect block b[bw->bpind] = alloc_blk(fs,nod); if(reduce) // free indirect block free_blk(fs, b[bw->bpind]); - b = (uint32*)get_blk(fs, b[bw->bpind]); + b = get_blkmap(fs, b[bw->bpind], &bmi2); bkref = &b[bw->bpdind]; if(extend) // allocate first block *bkref = hole ? 0 : alloc_blk(fs,nod); @@ -1094,20 +1670,20 @@ bw->bpdind = 0; bw->bptind = 0; if(extend) // allocate triple indirect block - get_nod(fs, nod)->i_block[bw->bpdir] = alloc_blk(fs,nod); + iblk[bw->bpdir] = alloc_blk(fs,nod); if(reduce) // free triple indirect block - free_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); - b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); + free_blk(fs, iblk[bw->bpdir]); + b = get_blkmap(fs, iblk[bw->bpdir], &bmi1); if(extend) // allocate first double indirect block b[bw->bpind] = alloc_blk(fs,nod); if(reduce) // free first double indirect block free_blk(fs, b[bw->bpind]); - b = (uint32*)get_blk(fs, b[bw->bpind]); + b = get_blkmap(fs, b[bw->bpind], &bmi2); if(extend) // allocate first indirect block b[bw->bpdind] = alloc_blk(fs,nod); if(reduce) // free first indirect block free_blk(fs, b[bw->bpind]); - b = (uint32*)get_blk(fs, b[bw->bpdind]); + b = get_blkmap(fs, b[bw->bpdind], &bmi3); bkref = &b[bw->bptind]; if(extend) // allocate first data block *bkref = hole ? 0 : alloc_blk(fs,nod); @@ -1121,9 +1697,9 @@ (bw->bptind < BLOCKSIZE/4 -1) ) { bw->bptind++; - b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); - b = (uint32*)get_blk(fs, b[bw->bpind]); - b = (uint32*)get_blk(fs, b[bw->bpdind]); + b = get_blkmap(fs, iblk[bw->bpdir], &bmi1); + b = get_blkmap(fs, b[bw->bpind], &bmi2); + b = get_blkmap(fs, b[bw->bpdind], &bmi3); bkref = &b[bw->bptind]; if(extend) // allocate data block *bkref = hole ? 0 : alloc_blk(fs,nod); @@ -1140,13 +1716,13 @@ bw->bnum++; bw->bptind = 0; bw->bpdind++; - b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); - b = (uint32*)get_blk(fs, b[bw->bpind]); + b = get_blkmap(fs, iblk[bw->bpdir], &bmi1); + b = get_blkmap(fs, b[bw->bpind], &bmi2); if(extend) // allocate single indirect block b[bw->bpdind] = alloc_blk(fs,nod); if(reduce) // free indirect block free_blk(fs, b[bw->bpind]); - b = (uint32*)get_blk(fs, b[bw->bpdind]); + b = get_blkmap(fs, b[bw->bpdind], &bmi3); bkref = &b[bw->bptind]; if(extend) // allocate first data block *bkref = hole ? 0 : alloc_blk(fs,nod); @@ -1163,17 +1739,17 @@ bw->bpdind = 0; bw->bptind = 0; bw->bpind++; - b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); + b = get_blkmap(fs, iblk[bw->bpdir], &bmi1); if(extend) // allocate double indirect block b[bw->bpind] = alloc_blk(fs,nod); if(reduce) // free double indirect block free_blk(fs, b[bw->bpind]); - b = (uint32*)get_blk(fs, b[bw->bpind]); + b = get_blkmap(fs, b[bw->bpind], &bmi2); if(extend) // allocate single indirect block b[bw->bpdind] = alloc_blk(fs,nod); if(reduce) // free indirect block free_blk(fs, b[bw->bpind]); - b = (uint32*)get_blk(fs, b[bw->bpdind]); + b = get_blkmap(fs, b[bw->bpdind], &bmi3); bkref = &b[bw->bptind]; if(extend) // allocate first block *bkref = hole ? 0 : alloc_blk(fs,nod); @@ -1184,56 +1760,105 @@ error_msg_and_die("file too big !"); /* End change for walking triple indirection */ - if(*bkref) - { + bk = *bkref; + if (bmi3) + put_blkmap(bmi3); + if (bmi2) + put_blkmap(bmi2); + if (bmi1) + put_blkmap(bmi1); + + if(bk) + { + blk_info *bi; + gd_info *gi; + uint8 *block; bw->bnum++; - if(!reduce && !allocated(GRP_GET_BLOCK_BITMAP(fs,*bkref), GRP_BBM_OFFSET(fs,*bkref))) - error_msg_and_die("[block %d of inode %d is unallocated !]", *bkref, nod); + block = GRP_GET_BLOCK_BITMAP(fs,bk,&bi,&gi); + if(!reduce && !allocated(block, GRP_BBM_OFFSET(fs,bk))) + error_msg_and_die("[block %d of inode %d is unallocated !]", bk, nod); + GRP_PUT_BLOCK_BITMAP(bi, gi); } if(extend) - get_nod(fs, nod)->i_blocks = bw->bnum * INOBLK; - return *bkref; + inod->i_blocks = bw->bnum * INOBLK; + put_nod(ni); + return bk; } -// add blocks to an inode (file/dir/etc...) -static void -extend_blk(filesystem *fs, uint32 nod, block b, int amount) +typedef struct { - int create = amount; - blockwalker bw, lbw; - uint32 bk; - init_bw(&bw); - if(amount < 0) - { - uint32 i; - for(i = 0; i < get_nod(fs, nod)->i_blocks / INOBLK + amount; i++) - walk_bw(fs, nod, &bw, 0, 0); - while(walk_bw(fs, nod, &bw, &create, 0) != WALK_END) + blockwalker bw; + uint32 nod; + nod_info *ni; + inode *inod; +} inode_pos; +#define INODE_POS_TRUNCATE 0 +#define INODE_POS_EXTEND 1 + +// Call this to set up an ipos structure for future use with +// extend_inode_blk to append blocks to the given inode. If +// op is INODE_POS_TRUNCATE, the inode is truncated to zero size. +// If op is INODE_POS_EXTEND, the position is moved to the end +// of the inode's data blocks. +// Call inode_pos_finish when done with the inode_pos structure. +static void +inode_pos_init(filesystem *fs, inode_pos *ipos, uint32 nod, int op, + blockwalker *endbw) +{ + blockwalker lbw; + + init_bw(&ipos->bw); + ipos->nod = nod; + ipos->inod = get_nod(fs, nod, &ipos->ni); + if (op == INODE_POS_TRUNCATE) { + int32 create = -1; + while(walk_bw(fs, nod, &ipos->bw, &create, 0) != WALK_END) /*nop*/; - get_nod(fs, nod)->i_blocks += amount * INOBLK; + ipos->inod->i_blocks = 0; } - else + + if (endbw) + ipos->bw = *endbw; + else { + /* Seek to the end */ + init_bw(&ipos->bw); + lbw = ipos->bw; + while(walk_bw(fs, nod, &ipos->bw, 0, 0) != WALK_END) + lbw = ipos->bw; + ipos->bw = lbw; + } +} + +// Clean up the inode_pos structure. +static void +inode_pos_finish(filesystem *fs, inode_pos *ipos) +{ + put_nod(ipos->ni); +} + +// add blocks to an inode (file/dir/etc...) at the given position. +// This will only work when appending to the end of an inode. +static void +extend_inode_blk(filesystem *fs, inode_pos *ipos, block b, int amount) +{ + uint32 bk; + uint32 pos; + + if (amount < 0) + error_msg_and_die("extend_inode_blk: Got negative amount"); + + for (pos = 0; amount; pos += BLOCKSIZE) { - lbw = bw; - while((bk = walk_bw(fs, nod, &bw, 0, 0)) != WALK_END) - lbw = bw; - bw = lbw; - while(create) - { - int i, copyb = 0; - if(!(fs->sb.s_reserved[200] & OP_HOLES)) - copyb = 1; - else - for(i = 0; i < BLOCKSIZE / 4; i++) - if(((int32*)(b + BLOCKSIZE * (amount - create)))[i]) - { - copyb = 1; - break; - } - if((bk = walk_bw(fs, nod, &bw, &create, !copyb)) == WALK_END) - break; - if(copyb) - memcpy(get_blk(fs, bk), b + BLOCKSIZE * (amount - create - 1), BLOCKSIZE); + int hole = (fs->holes && is_blk_empty(b + pos)); + + bk = walk_bw(fs, ipos->nod, &ipos->bw, &amount, hole); + if (bk == WALK_END) + error_msg_and_die("extend_inode_blk: extend failed"); + if (!hole) { + blk_info *bi; + uint8 *block = get_blk(fs, bk, &bi); + memcpy(block, b + pos, BLOCKSIZE); + put_blk(bi); } } } @@ -1242,15 +1867,17 @@ static void add2dir(filesystem *fs, uint32 dnod, uint32 nod, const char* name) { - blockwalker bw; + blockwalker bw, lbw; uint32 bk; - uint8 *b; directory *d; + dirwalker dw; int reclen, nlen; inode *node; inode *pnode; + nod_info *dni, *ni; + inode_pos ipos; - pnode = get_nod(fs, dnod); + pnode = get_nod(fs, dnod, &dni); if((pnode->i_mode & FM_IFMT) != FM_IFDIR) error_msg_and_die("can't add '%s' to a non-directory", name); if(!*name) @@ -1262,52 +1889,52 @@ if(reclen > BLOCKSIZE) error_msg_and_die("bad name '%s' (too long)", name); init_bw(&bw); + lbw = bw; while((bk = walk_bw(fs, dnod, &bw, 0, 0)) != WALK_END) // for all blocks in dir { - b = get_blk(fs, bk); // for all dir entries in block - for(d = (directory*)b; (int8*)d + sizeof(*d) < (int8*)b + BLOCKSIZE; d = (directory*)((int8*)d + d->d_rec_len)) + for(d = get_dir(fs, bk, &dw); d; d = next_dir(&dw)) { // if empty dir entry, large enough, use it if((!d->d_inode) && (d->d_rec_len >= reclen)) { d->d_inode = nod; - node = get_nod(fs, nod); + node = get_nod(fs, nod, &ni); + dir_set_name(&dw, name, nlen); + put_dir(&dw); node->i_links_count++; - d->d_name_len = nlen; - strncpy(d->d_name, name, nlen); - return; + put_nod(ni); + goto out; } // if entry with enough room (last one?), shrink it & use it if(d->d_rec_len >= (sizeof(directory) + rndup(d->d_name_len, 4) + reclen)) { - reclen = d->d_rec_len; - d->d_rec_len = sizeof(directory) + rndup(d->d_name_len, 4); - reclen -= d->d_rec_len; - d = (directory*) (((int8*)d) + d->d_rec_len); - d->d_rec_len = reclen; - d->d_inode = nod; - node = get_nod(fs, nod); + d = shrink_dir(&dw, nod, name, nlen); + put_dir(&dw); + node = get_nod(fs, nod, &ni); node->i_links_count++; - d->d_name_len = nlen; - strncpy(d->d_name, name, nlen); - return; + put_nod(ni); + goto out; } } + put_dir(&dw); + lbw = bw; } // we found no free entry in the directory, so we add a block - if(!(b = get_workblk())) - error_msg_and_die("get_workblk() failed."); - d = (directory*)b; - d->d_inode = nod; - node = get_nod(fs, nod); + node = get_nod(fs, nod, &ni); + d = new_dir(fs, nod, name, nlen, &dw); node->i_links_count++; - d->d_rec_len = BLOCKSIZE; - d->d_name_len = nlen; - strncpy(d->d_name, name, nlen); - extend_blk(fs, dnod, b, 1); - get_nod(fs, dnod)->i_size += BLOCKSIZE; - free_workblk(b); + put_nod(ni); + next_dir(&dw); // Force the data into the buffer + + inode_pos_init(fs, &ipos, dnod, INODE_POS_EXTEND, &lbw); + extend_inode_blk(fs, &ipos, dir_data(&dw), 1); + inode_pos_finish(fs, &ipos); + + put_dir(&dw); + pnode->i_size += BLOCKSIZE; +out: + put_nod(dni); } // find an entry in a directory @@ -1321,11 +1948,13 @@ while((bk = walk_bw(fs, nod, &bw, 0, 0)) != WALK_END) { directory *d; - uint8 *b; - b = get_blk(fs, bk); - for(d = (directory*)b; (int8*)d + sizeof(*d) < (int8*)b + BLOCKSIZE; d = (directory*)((int8*)d + d->d_rec_len)) - if(d->d_inode && (nlen == d->d_name_len) && !strncmp(d->d_name, name, nlen)) + dirwalker dw; + for (d = get_dir(fs, bk, &dw); d; d=next_dir(&dw)) + if(d->d_inode && (nlen == d->d_name_len) && !strncmp(dir_name(&dw), name, nlen)) { + put_dir(&dw); return d->d_inode; + } + put_dir(&dw); } return 0; } @@ -1356,47 +1985,55 @@ return nod; } +// chmod an inode +void +chmod_fs(filesystem *fs, uint32 nod, uint16 mode, uint16 uid, uint16 gid) +{ + inode *node; + nod_info *ni; + node = get_nod(fs, nod, &ni); + node->i_mode = (node->i_mode & ~FM_IMASK) | (mode & FM_IMASK); + node->i_uid = uid; + node->i_gid = gid; + put_nod(ni); +} + // create a simple inode static uint32 mknod_fs(filesystem *fs, uint32 parent_nod, const char *name, uint16 mode, uint16 uid, uint16 gid, uint8 major, uint8 minor, uint32 ctime, uint32 mtime) { uint32 nod; inode *node; - if((nod = find_dir(fs, parent_nod, name))) - { - node = get_nod(fs, nod); - if((node->i_mode & FM_IFMT) != (mode & FM_IFMT)) - error_msg_and_die("node '%s' already exists and isn't of the same type", name); - node->i_mode = mode; - } - else + nod_info *ni; + gd_info *gi; + + nod = alloc_nod(fs); + node = get_nod(fs, nod, &ni); + node->i_mode = mode; + add2dir(fs, parent_nod, nod, name); + switch(mode & FM_IFMT) { - nod = alloc_nod(fs); - node = get_nod(fs, nod); - node->i_mode = mode; - add2dir(fs, parent_nod, nod, name); - switch(mode & FM_IFMT) - { - case FM_IFLNK: - mode = FM_IFLNK | FM_IRWXU | FM_IRWXG | FM_IRWXO; - break; - case FM_IFBLK: - case FM_IFCHR: - ((uint8*)get_nod(fs, nod)->i_block)[0] = minor; - ((uint8*)get_nod(fs, nod)->i_block)[1] = major; - break; - case FM_IFDIR: - add2dir(fs, nod, nod, "."); - add2dir(fs, nod, parent_nod, ".."); - fs->gd[GRP_GROUP_OF_INODE(fs,nod)].bg_used_dirs_count++; - break; - } + case FM_IFLNK: + mode = FM_IFLNK | FM_IRWXU | FM_IRWXG | FM_IRWXO; + break; + case FM_IFBLK: + case FM_IFCHR: + ((uint8*)node->i_block)[0] = minor; + ((uint8*)node->i_block)[1] = major; + break; + case FM_IFDIR: + add2dir(fs, nod, nod, "."); + add2dir(fs, nod, parent_nod, ".."); + get_gd(fs,GRP_GROUP_OF_INODE(fs,nod),&gi)->bg_used_dirs_count++; + put_gd(gi); + break; } node->i_uid = uid; node->i_gid = gid; node->i_atime = mtime; node->i_ctime = ctime; node->i_mtime = mtime; + put_nod(ni); return nod; } @@ -1413,33 +2050,73 @@ mklink_fs(filesystem *fs, uint32 parent_nod, const char *name, size_t size, uint8 *b, uid_t uid, gid_t gid, uint32 ctime, uint32 mtime) { uint32 nod = mknod_fs(fs, parent_nod, name, FM_IFLNK | FM_IRWXU | FM_IRWXG | FM_IRWXO, uid, gid, 0, 0, ctime, mtime); - extend_blk(fs, nod, 0, - (int)get_nod(fs, nod)->i_blocks / INOBLK); - get_nod(fs, nod)->i_size = size; - if(size <= 4 * (EXT2_TIND_BLOCK+1)) - { - strncpy((char*)get_nod(fs, nod)->i_block, (char*)b, size); + nod_info *ni; + inode *node = get_nod(fs, nod, &ni); + inode_pos ipos; + + inode_pos_init(fs, &ipos, nod, INODE_POS_TRUNCATE, NULL); + node->i_size = size; + if(size < 4 * (EXT2_TIND_BLOCK+1)) + { + strncpy((char*)node->i_block, (char*)b, size); + ((char*)node->i_block)[size+1] = '\0'; + inode_pos_finish(fs, &ipos); + put_nod(ni); return nod; } - extend_blk(fs, nod, b, rndup(size, BLOCKSIZE) / BLOCKSIZE); + extend_inode_blk(fs, &ipos, b, rndup(size, BLOCKSIZE) / BLOCKSIZE); + inode_pos_finish(fs, &ipos); + put_nod(ni); return nod; } +static void +fs_upgrade_rev1_largefile(filesystem *fs) +{ + fs->sb->s_rev_level = 1; + fs->sb->s_first_ino = EXT2_GOOD_OLD_FIRST_INO; + fs->sb->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE; +} + +#define COPY_BLOCKS 16 +#define CB_SIZE (COPY_BLOCKS * BLOCKSIZE) + // make a file from a FILE* static uint32 -mkfile_fs(filesystem *fs, uint32 parent_nod, const char *name, uint32 mode, size_t size, FILE *f, uid_t uid, gid_t gid, uint32 ctime, uint32 mtime) +mkfile_fs(filesystem *fs, uint32 parent_nod, const char *name, uint32 mode, FILE *f, uid_t uid, gid_t gid, uint32 ctime, uint32 mtime) { uint8 * b; uint32 nod = mknod_fs(fs, parent_nod, name, mode|FM_IFREG, uid, gid, 0, 0, ctime, mtime); - extend_blk(fs, nod, 0, - (int)get_nod(fs, nod)->i_blocks / INOBLK); - get_nod(fs, nod)->i_size = size; - if (size) { - if(!(b = (uint8*)calloc(rndup(size, BLOCKSIZE), 1))) - error_msg_and_die("not enough mem to read file '%s'", name); - if(f) - fread(b, size, 1, f); // FIXME: ugly. use mmap() ... - extend_blk(fs, nod, b, rndup(size, BLOCKSIZE) / BLOCKSIZE); - free(b); - } + nod_info *ni; + inode *node = get_nod(fs, nod, &ni); + off_t size = 0; + size_t readbytes; + inode_pos ipos; + int fullsize; + + b = malloc(CB_SIZE); + if (!b) + error_msg_and_die("mkfile_fs: out of memory"); + inode_pos_init(fs, &ipos, nod, INODE_POS_TRUNCATE, NULL); + readbytes = fread(b, 1, CB_SIZE, f); + while (readbytes) { + fullsize = rndup(readbytes, BLOCKSIZE); + // Fill to end of block with zeros. + memset(b + readbytes, 0, fullsize - readbytes); + extend_inode_blk(fs, &ipos, b, fullsize / BLOCKSIZE); + size += readbytes; + readbytes = fread(b, 1, CB_SIZE, f); + } + if (size > 0x7fffffff) { + if (fs->sb->s_rev_level < 1) + fs_upgrade_rev1_largefile(fs); + fs->sb->s_feature_ro_compat |= EXT2_FEATURE_RO_COMPAT_LARGE_FILE; + } + node->i_dir_acl = size >> 32; + node->i_size = size; + inode_pos_finish(fs, &ipos); + put_nod(ni); + free(b); return nod; } @@ -1591,13 +2268,24 @@ dname = malloc(len + 1); for(i = start; i < count; i++) { + uint32 oldnod; SNPRINTF(dname, len, "%s%lu", name, i); - mknod_fs(fs, nod, dname, mode, uid, gid, major, minor + (i * increment - start), ctime, mtime); + oldnod = find_dir(fs, nod, dname); + if(oldnod) + chmod_fs(fs, oldnod, mode, uid, gid); + else + mknod_fs(fs, nod, dname, mode, uid, gid, major, minor + (i * increment - start), ctime, mtime); } free(dname); } else - mknod_fs(fs, nod, name, mode, uid, gid, major, minor, ctime, mtime); + { + uint32 oldnod = find_dir(fs, nod, name); + if(oldnod) + chmod_fs(fs, oldnod, mode, uid, gid); + else + mknod_fs(fs, nod, name, mode, uid, gid, major, minor, ctime, mtime); + } } } if (line) @@ -1643,6 +2331,10 @@ switch(st.st_mode & S_IFMT) { case S_IFLNK: + if((st.st_mode & S_IFMT) == S_IFREG || st.st_size >= 4 * (EXT2_TIND_BLOCK+1)) + stats->nblocks += (st.st_size + BLOCKSIZE - 1) / BLOCKSIZE; + stats->ninodes++; + break; case S_IFREG: if((st.st_mode & S_IFMT) == S_IFREG || st.st_size > 4 * (EXT2_TIND_BLOCK+1)) stats->nblocks += (st.st_size + BLOCKSIZE - 1) / BLOCKSIZE; @@ -1657,19 +2349,33 @@ if(chdir(dent->d_name) < 0) perror_msg_and_die(dent->d_name); add2fs_from_dir(fs, this_nod, squash_uids, squash_perms, fs_timestamp, stats); - chdir(".."); + if (chdir("..") == -1) + perror_msg_and_die(".."); + break; default: break; } else { + if((nod = find_dir(fs, this_nod, name))) + { + error_msg("ignoring duplicate entry %s", name); + if(S_ISDIR(st.st_mode)) { + if(chdir(dent->d_name) < 0) + perror_msg_and_die(name); + add2fs_from_dir(fs, nod, squash_uids, squash_perms, fs_timestamp, stats); + if (chdir("..") == -1) + perror_msg_and_die(".."); + } + continue; + } save_nod = 0; /* Check for hardlinks */ if (!S_ISDIR(st.st_mode) && !S_ISLNK(st.st_mode) && st.st_nlink > 1) { - int32 hdlink = is_hardlink(st.st_ino); + int32 hdlink = is_hardlink(fs, st.st_ino); if (hdlink >= 0) { - add2dir(fs, this_nod, hdlinks.hdl[hdlink].dst_nod, name); + add2dir(fs, this_nod, fs->hdlinks.hdl[hdlink].dst_nod, name); continue; } else { save_nod = 1; @@ -1697,8 +2403,12 @@ free(lnk); break; case S_IFREG: - fh = xfopen(dent->d_name, "rb"); - nod = mkfile_fs(fs, this_nod, name, mode, st.st_size, fh, uid, gid, ctime, mtime); + fh = fopen(dent->d_name, "rb"); + if (!fh) { + error_msg("Unable to open file %s", dent->d_name); + break; + } + nod = mkfile_fs(fs, this_nod, name, mode, fh, uid, gid, ctime, mtime); fclose(fh); break; case S_IFDIR: @@ -1706,199 +2416,128 @@ if(chdir(dent->d_name) < 0) perror_msg_and_die(name); add2fs_from_dir(fs, nod, squash_uids, squash_perms, fs_timestamp, stats); - chdir(".."); + if (chdir("..") == -1) + perror_msg_and_die(".."); break; default: error_msg("ignoring entry %s", name); } if (save_nod) { - if (hdlinks.count == hdlink_cnt) { - if ((hdlinks.hdl = - realloc (hdlinks.hdl, (hdlink_cnt + HDLINK_CNT) * + if (fs->hdlinks.count == fs->hdlink_cnt) { + if ((fs->hdlinks.hdl = + realloc (fs->hdlinks.hdl, (fs->hdlink_cnt + HDLINK_CNT) * sizeof (struct hdlink_s))) == NULL) { error_msg_and_die("Not enough memory"); } - hdlink_cnt += HDLINK_CNT; + fs->hdlink_cnt += HDLINK_CNT; } - hdlinks.hdl[hdlinks.count].src_inode = st.st_ino; - hdlinks.hdl[hdlinks.count].dst_nod = nod; - hdlinks.count++; + fs->hdlinks.hdl[fs->hdlinks.count].src_inode = st.st_ino; + fs->hdlinks.hdl[fs->hdlinks.count].dst_nod = nod; + fs->hdlinks.count++; } } } closedir(dh); } -// endianness swap of x-indirect blocks +// Copy size blocks from src to dst, putting holes in the output +// file (if possible) if the input block is all zeros. +// Copy size blocks from src to dst, putting holes in the output +// file (if possible) if the input block is all zeros. static void -swap_goodblocks(filesystem *fs, inode *nod) +copy_file(filesystem *fs, FILE *dst, FILE *src, size_t size) { - uint32 i,j; - int done=0; - uint32 *b,*b2; + uint8 *b; - uint32 nblk = nod->i_blocks / INOBLK; - if((nod->i_size && !nblk) || ((nod->i_mode & FM_IFBLK) == FM_IFBLK) || ((nod->i_mode & FM_IFCHR) == FM_IFCHR)) - for(i = 0; i <= EXT2_TIND_BLOCK; i++) - nod->i_block[i] = swab32(nod->i_block[i]); - if(nblk <= EXT2_IND_BLOCK) - return; - swap_block(get_blk(fs, nod->i_block[EXT2_IND_BLOCK])); - if(nblk <= EXT2_DIND_BLOCK + BLOCKSIZE/4) - return; - /* Currently this will fail b'cos the number of blocks as stored - in i_blocks also includes the indirection blocks (see - walk_bw). But this function assumes that i_blocks only - stores the count of data blocks ( Actually according to - "Understanding the Linux Kernel" (Table 17-3 p502 1st Ed) - i_blocks IS supposed to store the count of data blocks). so - with a file of size 268K nblk would be 269.The above check - will be false even though double indirection hasn't been - started.This is benign as 0 means block 0 which has been - zeroed out and therefore points back to itself from any offset - */ - // FIXME: I have fixed that, but I have the feeling the rest of - // ths function needs to be fixed for the same reasons - Xav - assert(nod->i_block[EXT2_DIND_BLOCK] != 0); - for(i = 0; i < BLOCKSIZE/4; i++) - if(nblk > EXT2_IND_BLOCK + BLOCKSIZE/4 + (BLOCKSIZE/4)*i ) - swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i])); - swap_block(get_blk(fs, nod->i_block[EXT2_DIND_BLOCK])); - if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4 + BLOCKSIZE/4 * BLOCKSIZE/4) - return; - /* Adding support for triple indirection */ - b = (uint32*)get_blk(fs,nod->i_block[EXT2_TIND_BLOCK]); - for(i=0;i < BLOCKSIZE/4 && !done ; i++) { - b2 = (uint32*)get_blk(fs,b[i]); - for(j=0; j<BLOCKSIZE/4;j++) { - if (nblk > ( EXT2_IND_BLOCK + BLOCKSIZE/4 + - (BLOCKSIZE/4)*(BLOCKSIZE/4) + - i*(BLOCKSIZE/4)*(BLOCKSIZE/4) + - j*(BLOCKSIZE/4)) ) - swap_block(get_blk(fs,b2[j])); - else { - done = 1; - break; - } + b = malloc(BLOCKSIZE); + if (!b) + error_msg_and_die("copy_file: out of memory"); + if (fseek(src, 0, SEEK_SET)) + perror_msg_and_die("fseek"); + if (ftruncate(fileno(dst), 0)) + perror_msg_and_die("copy_file: ftruncate"); + while (size > 0) { + if (fread(b, BLOCKSIZE, 1, src) != 1) + perror_msg_and_die("copy failed on read"); + if ((dst != stdout) && fs->holes && is_blk_empty(b)) { + /* Empty block, just skip it */ + if (fseek(dst, BLOCKSIZE, SEEK_CUR)) + perror_msg_and_die("fseek"); + } else { + if (fwrite(b, BLOCKSIZE, 1, dst) != 1) + perror_msg_and_die("copy failed on write"); } - swap_block((uint8 *)b2); + size--; } - swap_block((uint8 *)b); - return; + free(b); } -static void -swap_badblocks(filesystem *fs, inode *nod) +// Allocate a new filesystem structure, allocate internal memory, +// and initialize the contents. +static filesystem * +alloc_fs(int swapit, char *fname, uint32 nbblocks, FILE *srcfile) { - uint32 i,j; - int done=0; - uint32 *b,*b2; + filesystem *fs; + struct stat srcstat, dststat; - uint32 nblk = nod->i_blocks / INOBLK; - if((nod->i_size && !nblk) || ((nod->i_mode & FM_IFBLK) == FM_IFBLK) || ((nod->i_mode & FM_IFCHR) == FM_IFCHR)) - for(i = 0; i <= EXT2_TIND_BLOCK; i++) - nod->i_block[i] = swab32(nod->i_block[i]); - if(nblk <= EXT2_IND_BLOCK) - return; - swap_block(get_blk(fs, nod->i_block[EXT2_IND_BLOCK])); - if(nblk <= EXT2_DIND_BLOCK + BLOCKSIZE/4) - return; - /* See comment in swap_goodblocks */ - assert(nod->i_block[EXT2_DIND_BLOCK] != 0); - swap_block(get_blk(fs, nod->i_block[EXT2_DIND_BLOCK])); - for(i = 0; i < BLOCKSIZE/4; i++) - if(nblk > EXT2_IND_BLOCK + BLOCKSIZE/4 + (BLOCKSIZE/4)*i ) - swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i])); - if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4 + BLOCKSIZE/4 * BLOCKSIZE/4) - return; - /* Adding support for triple indirection */ - b = (uint32*)get_blk(fs,nod->i_block[EXT2_TIND_BLOCK]); - swap_block((uint8 *)b); - for(i=0;i < BLOCKSIZE/4 && !done ; i++) { - b2 = (uint32*)get_blk(fs,b[i]); - swap_block((uint8 *)b2); - for(j=0; j<BLOCKSIZE/4;j++) { - if (nblk > ( EXT2_IND_BLOCK + BLOCKSIZE/4 + - (BLOCKSIZE/4)*(BLOCKSIZE/4) + - i*(BLOCKSIZE/4)*(BLOCKSIZE/4) + - j*(BLOCKSIZE/4)) ) - swap_block(get_blk(fs,b2[j])); - else { - done = 1; - break; - } - } - } - return; -} + fs = malloc(sizeof(*fs)); + if (!fs) + error_msg_and_die("not enough memory for filesystem"); + memset(fs, 0, sizeof(*fs)); + fs->swapit = swapit; + cache_init(&fs->blks, MAX_FREE_CACHE_BLOCKS, blk_elem_val, blk_freed); + cache_init(&fs->gds, MAX_FREE_CACHE_GDS, gd_elem_val, gd_freed); + cache_init(&fs->blkmaps, MAX_FREE_CACHE_BLOCKMAPS, + blkmap_elem_val, blkmap_freed); + cache_init(&fs->inodes, MAX_FREE_CACHE_INODES, + inode_elem_val, inode_freed); + fs->hdlink_cnt = HDLINK_CNT; + fs->hdlinks.hdl = calloc(sizeof(struct hdlink_s), fs->hdlink_cnt); + if (!fs->hdlinks.hdl) + error_msg_and_die("Not enough memory"); + fs->hdlinks.count = 0 ; -// endianness swap of the whole filesystem -static void -swap_goodfs(filesystem *fs) -{ - uint32 i; - for(i = 1; i < fs->sb.s_inodes_count; i++) - { - inode *nod = get_nod(fs, i); - if(nod->i_mode & FM_IFDIR) - { - blockwalker bw; - uint32 bk; - init_bw(&bw); - while((bk = walk_bw(fs, i, &bw, 0, 0)) != WALK_END) - { - directory *d; - uint8 *b; - b = get_blk(fs, bk); - for(d = (directory*)b; (int8*)d + sizeof(*d) < (int8*)b + BLOCKSIZE; d = (directory*)((int8*)d + swab16(d->d_rec_len))) - swap_dir(d); - } - } - swap_goodblocks(fs, nod); - swap_nod(nod); - } - for(i=0;i<GRP_NBGROUPS(fs);i++) - swap_gd(&(fs->gd[i])); - swap_sb(&fs->sb); + if (strcmp(fname, "-") == 0) + fs->f = tmpfile(); + else if (srcfile) { + if (fstat(fileno(srcfile), &srcstat)) + perror_msg_and_die("fstat srcfile"); + if (stat(fname, &dststat) == 0 + && srcstat.st_ino == dststat.st_ino + && srcstat.st_dev == dststat.st_dev) + { + // source and destination are the same file, don't + // truncate or copy, just use the file. + fs->f = fopen(fname, "r+b"); + } else { + fs->f = fopen(fname, "w+b"); + if (fs->f) + copy_file(fs, fs->f, srcfile, nbblocks); + } + } else + fs->f = fopen(fname, "w+b"); + if (!fs->f) + perror_msg_and_die("opening %s", fname); + return fs; } +/* Make sure the output file is the right size */ static void -swap_badfs(filesystem *fs) +set_file_size(filesystem *fs) { - uint32 i; - swap_sb(&fs->sb); - for(i=0;i<GRP_NBGROUPS(fs);i++) - swap_gd(&(fs->gd[i])); - for(i = 1; i < fs->sb.s_inodes_count; i++) - { - inode *nod = get_nod(fs, i); - swap_nod(nod); - swap_badblocks(fs, nod); - if(nod->i_mode & FM_IFDIR) - { - blockwalker bw; - uint32 bk; - init_bw(&bw); - while((bk = walk_bw(fs, i, &bw, 0, 0)) != WALK_END) - { - directory *d; - uint8 *b; - b = get_blk(fs, bk); - for(d = (directory*)b; (int8*)d + sizeof(*d) < (int8*)b + BLOCKSIZE; d = (directory*)((int8*)d + d->d_rec_len)) - swap_dir(d); - } - } - } + if (ftruncate(fileno(fs->f), + ((off_t) fs->sb->s_blocks_count) * BLOCKSIZE)) + perror_msg_and_die("set_file_size: ftruncate"); } // initialize an empty filesystem static filesystem * -init_fs(int nbblocks, int nbinodes, int nbresrvd, int holes, uint32 fs_timestamp) +init_fs(int nbblocks, int nbinodes, int nbresrvd, int holes, + uint32 fs_timestamp, uint32 creator_os, int swapit, char *fname) { uint32 i; filesystem *fs; - directory *d; - uint8 * b; + dirwalker dw; uint32 nod, first_block; uint32 nbgroups,nbinodes_per_group,overhead_per_group,free_blocks, free_blocks_per_group,nbblocks_per_group,min_nbgroups; @@ -1906,6 +2545,11 @@ uint32 j; uint8 *bbm,*ibm; inode *itab0; + blk_info *bi; + nod_info *ni; + groupdescriptor *gd; + gd_info *gi; + inode_pos ipos; if(nbresrvd < 0) error_msg_and_die("reserved blocks value is invalid. Note: options have changed, see --help or the man page."); @@ -1919,10 +2563,14 @@ */ min_nbgroups = (nbinodes + INODES_PER_GROUP - 1) / INODES_PER_GROUP; + /* On filesystems with 1k block size, the bootloader area uses a full + * block. For 2048 and up, the superblock can be fitted into block 0. + */ + first_block = (BLOCKSIZE == 1024); + /* nbblocks is the total number of blocks in the filesystem. * a block group can have no more than 8192 blocks. */ - first_block = (BLOCKSIZE == 1024); nbgroups = (nbblocks - first_block + BLOCKS_PER_GROUP - 1) / BLOCKS_PER_GROUP; if(nbgroups < min_nbgroups) nbgroups = min_nbgroups; nbblocks_per_group = rndup((nbblocks - first_block + nbgroups - 1)/nbgroups, 8); @@ -1934,51 +2582,59 @@ gdsz = rndup(nbgroups*sizeof(groupdescriptor),BLOCKSIZE)/BLOCKSIZE; itblsz = nbinodes_per_group * sizeof(inode)/BLOCKSIZE; overhead_per_group = 3 /*sb,bbm,ibm*/ + gdsz + itblsz; - if((uint32)nbblocks - 1 < overhead_per_group * nbgroups) - error_msg_and_die("too much overhead, try fewer inodes or more blocks. Note: options have changed, see --help or the man page."); - free_blocks = nbblocks - overhead_per_group*nbgroups - 1 /*boot block*/; + free_blocks = nbblocks - overhead_per_group*nbgroups - first_block; free_blocks_per_group = nbblocks_per_group - overhead_per_group; + if(free_blocks < 0) + error_msg_and_die("too much overhead, try fewer inodes or more blocks. Note: options have changed, see --help or the man page."); - if(!(fs = (filesystem*)calloc(nbblocks, BLOCKSIZE))) - error_msg_and_die("not enough memory for filesystem"); + fs = alloc_fs(swapit, fname, nbblocks, NULL); + fs->sb = calloc(1, SUPERBLOCK_SIZE); + if (!fs->sb) + error_msg_and_die("error allocating header memory"); // create the superblock for an empty filesystem - fs->sb.s_inodes_count = nbinodes_per_group * nbgroups; - fs->sb.s_blocks_count = nbblocks; - fs->sb.s_r_blocks_count = nbresrvd; - fs->sb.s_free_blocks_count = free_blocks; - fs->sb.s_free_inodes_count = fs->sb.s_inodes_count - EXT2_FIRST_INO + 1; - fs->sb.s_first_data_block = first_block; - fs->sb.s_log_block_size = BLOCKSIZE >> 11; - fs->sb.s_log_frag_size = BLOCKSIZE >> 11; - fs->sb.s_blocks_per_group = nbblocks_per_group; - fs->sb.s_frags_per_group = nbblocks_per_group; - fs->sb.s_inodes_per_group = nbinodes_per_group; - fs->sb.s_wtime = fs_timestamp; - fs->sb.s_magic = EXT2_MAGIC_NUMBER; - fs->sb.s_lastcheck = fs_timestamp; + fs->sb->s_inodes_count = nbinodes_per_group * nbgroups; + fs->sb->s_blocks_count = nbblocks; + fs->sb->s_r_blocks_count = nbresrvd; + fs->sb->s_free_blocks_count = free_blocks; + fs->sb->s_free_inodes_count = fs->sb->s_inodes_count - EXT2_FIRST_INO + 1; + fs->sb->s_first_data_block = first_block; + fs->sb->s_log_block_size = BLOCKSIZE >> 11; + fs->sb->s_log_frag_size = BLOCKSIZE >> 11; + fs->sb->s_blocks_per_group = nbblocks_per_group; + fs->sb->s_frags_per_group = nbblocks_per_group; + fs->sb->s_inodes_per_group = nbinodes_per_group; + fs->sb->s_wtime = fs_timestamp; + fs->sb->s_magic = EXT2_MAGIC_NUMBER; + fs->sb->s_lastcheck = fs_timestamp; + fs->sb->s_creator_os = creator_os; + + set_file_size(fs); // set up groupdescriptors - for(i=0, bbmpos=gdsz+2, ibmpos=bbmpos+1, itblpos=ibmpos+1; + for(i=0, bbmpos=first_block+1+gdsz, ibmpos=bbmpos+1, itblpos=ibmpos+1; i<nbgroups; i++, bbmpos+=nbblocks_per_group, ibmpos+=nbblocks_per_group, itblpos+=nbblocks_per_group) { + gd = get_gd(fs, i, &gi); + if(free_blocks > free_blocks_per_group) { - fs->gd[i].bg_free_blocks_count = free_blocks_per_group; + gd->bg_free_blocks_count = free_blocks_per_group; free_blocks -= free_blocks_per_group; } else { - fs->gd[i].bg_free_blocks_count = free_blocks; + gd->bg_free_blocks_count = free_blocks; free_blocks = 0; // this is the last block group } if(i) - fs->gd[i].bg_free_inodes_count = nbinodes_per_group; + gd->bg_free_inodes_count = nbinodes_per_group; else - fs->gd[i].bg_free_inodes_count = nbinodes_per_group - + gd->bg_free_inodes_count = nbinodes_per_group - EXT2_FIRST_INO + 2; - fs->gd[i].bg_used_dirs_count = 0; - fs->gd[i].bg_block_bitmap = bbmpos; - fs->gd[i].bg_inode_bitmap = ibmpos; - fs->gd[i].bg_inode_table = itblpos; + gd->bg_used_dirs_count = 0; + gd->bg_block_bitmap = bbmpos; + gd->bg_inode_bitmap = ibmpos; + gd->bg_inode_table = itblpos; + put_gd(gi); } /* Mark non-filesystem blocks and inodes as allocated */ @@ -1984,110 +2640,143 @@ /* Mark non-filesystem blocks and inodes as allocated */ /* Mark system blocks and inodes as allocated */ for(i = 0; i<nbgroups;i++) { - /* Block bitmap */ - bbm = get_blk(fs,fs->gd[i].bg_block_bitmap); + gd = get_gd(fs, i, &gi); + bbm = GRP_GET_GROUP_BBM(fs, gd, &bi); //non-filesystem blocks - for(j = fs->gd[i].bg_free_blocks_count + for(j = gd->bg_free_blocks_count + overhead_per_group + 1; j <= BLOCKSIZE * 8; j++) allocate(bbm, j); //system blocks for(j = 1; j <= overhead_per_group; j++) allocate(bbm, j); - + GRP_PUT_GROUP_BBM(bi); + /* Inode bitmap */ - ibm = get_blk(fs,fs->gd[i].bg_inode_bitmap); + ibm = GRP_GET_GROUP_IBM(fs, gd, &bi); //non-filesystem inodes - for(j = fs->sb.s_inodes_per_group+1; j <= BLOCKSIZE * 8; j++) + for(j = fs->sb->s_inodes_per_group+1; j <= BLOCKSIZE * 8; j++) allocate(ibm, j); //system inodes if(i == 0) for(j = 1; j < EXT2_FIRST_INO; j++) allocate(ibm, j); + GRP_PUT_GROUP_IBM(bi); + put_gd(gi); } // make root inode and directory /* We have groups now. Add the root filesystem in group 0 */ /* Also increment the directory count for group 0 */ - fs->gd[0].bg_free_inodes_count--; - fs->gd[0].bg_used_dirs_count = 1; - itab0 = (inode *)get_blk(fs,fs->gd[0].bg_inode_table); - itab0[EXT2_ROOT_INO-1].i_mode = FM_IFDIR | FM_IRWXU | FM_IRGRP | FM_IROTH | FM_IXGRP | FM_IXOTH; - itab0[EXT2_ROOT_INO-1].i_ctime = fs_timestamp; - itab0[EXT2_ROOT_INO-1].i_mtime = fs_timestamp; - itab0[EXT2_ROOT_INO-1].i_atime = fs_timestamp; - itab0[EXT2_ROOT_INO-1].i_size = BLOCKSIZE; - itab0[EXT2_ROOT_INO-1].i_links_count = 2; - - if(!(b = get_workblk())) - error_msg_and_die("get_workblk() failed."); - d = (directory*)b; - d->d_inode = EXT2_ROOT_INO; - d->d_rec_len = sizeof(directory)+4; - d->d_name_len = 1; - strcpy(d->d_name, "."); - d = (directory*)(b + d->d_rec_len); - d->d_inode = EXT2_ROOT_INO; - d->d_rec_len = BLOCKSIZE - (sizeof(directory)+4); - d->d_name_len = 2; - strcpy(d->d_name, ".."); - extend_blk(fs, EXT2_ROOT_INO, b, 1); + gd = get_gd(fs, 0, &gi); + gd->bg_free_inodes_count--; + gd->bg_used_dirs_count = 1; + put_gd(gi); + itab0 = get_nod(fs, EXT2_ROOT_INO, &ni); + itab0->i_mode = FM_IFDIR | FM_IRWXU | FM_IRGRP | FM_IROTH | FM_IXGRP | FM_IXOTH; + itab0->i_ctime = fs_timestamp; + itab0->i_mtime = fs_timestamp; + itab0->i_atime = fs_timestamp; + itab0->i_size = BLOCKSIZE; + itab0->i_links_count = 2; + put_nod(ni); + + new_dir(fs, EXT2_ROOT_INO, ".", 1, &dw); + shrink_dir(&dw, EXT2_ROOT_INO, "..", 2); + next_dir(&dw); // Force the data into the buffer + inode_pos_init(fs, &ipos, EXT2_ROOT_INO, INODE_POS_EXTEND, NULL); + extend_inode_blk(fs, &ipos, dir_data(&dw), 1); + inode_pos_finish(fs, &ipos); + put_dir(&dw); - // make lost+found directory and reserve blocks - if(fs->sb.s_r_blocks_count) + // make lost+found directory + if(fs->sb->s_r_blocks_count) { - nod = mkdir_fs(fs, EXT2_ROOT_INO, "lost+found", FM_IRWXU, 0, 0, fs_timestamp, fs_timestamp); + inode *node; + uint8 *b; + + nod = mkdir_fs(fs, EXT2_ROOT_INO, "lost+found", FM_IRWXU, + 0, 0, fs_timestamp, fs_timestamp); + b = get_workblk(); memset(b, 0, BLOCKSIZE); ((directory*)b)->d_rec_len = BLOCKSIZE; - /* We run into problems with e2fsck if directory lost+found grows - * bigger than this. Need to find out why this happens - sundar - */ - if (fs->sb.s_r_blocks_count > fs->sb.s_blocks_count * MAX_RESERVED_BLOCKS ) - fs->sb.s_r_blocks_count = fs->sb.s_blocks_count * MAX_RESERVED_BLOCKS; - for(i = 1; i < fs->sb.s_r_blocks_count; i++) - extend_blk(fs, nod, b, 1); - get_nod(fs, nod)->i_size = fs->sb.s_r_blocks_count * BLOCKSIZE; + inode_pos_init(fs, &ipos, nod, INODE_POS_EXTEND, NULL); + // It is always 16 blocks to start out with + for(i = 1; i < 16; i++) + extend_inode_blk(fs, &ipos, b, 1); + inode_pos_finish(fs, &ipos); + free_workblk(b); + node = get_nod(fs, nod, &ni); + node->i_size = 16 * BLOCKSIZE; + put_nod(ni); } - free_workblk(b); // administrative info - fs->sb.s_state = 1; - fs->sb.s_max_mnt_count = 20; + fs->sb->s_state = 1; + fs->sb->s_max_mnt_count = 20; // options for me - if(holes) - fs->sb.s_reserved[200] |= OP_HOLES; + fs->holes = holes; return fs; } // loads a filesystem from disk static filesystem * -load_fs(FILE * fh, int swapit) +load_fs(FILE *fh, int swapit, char *fname) { - size_t fssize; + off_t fssize; filesystem *fs; - if((fseek(fh, 0, SEEK_END) < 0) || ((ssize_t)(fssize = ftell(fh)) == -1)) + + if((fseek(fh, 0, SEEK_END) < 0) || ((fssize = ftello(fh)) == -1)) perror_msg_and_die("input filesystem image"); rewind(fh); - fssize = (fssize + BLOCKSIZE - 1) / BLOCKSIZE; + if ((fssize % BLOCKSIZE) != 0) + error_msg_and_die("Input file not a multiple of block size"); + fssize /= BLOCKSIZE; if(fssize < 16) // totally arbitrary error_msg_and_die("too small filesystem"); - if(!(fs = (filesystem*)calloc(fssize, BLOCKSIZE))) - error_msg_and_die("not enough memory for filesystem"); - if(fread(fs, BLOCKSIZE, fssize, fh) != fssize) - perror_msg_and_die("input filesystem image"); + fs = alloc_fs(swapit, fname, fssize, fh); + + /* Read and check the superblock, then read the superblock + * and all the group descriptors */ + fs->sb = malloc(SUPERBLOCK_SIZE); + if (!fs->sb) + error_msg_and_die("error allocating header memory"); + if (fseek(fs->f, SUPERBLOCK_OFFSET, SEEK_SET)) + perror_msg_and_die("fseek"); + if (fread(fs->sb, SUPERBLOCK_SIZE, 1, fs->f) != 1) + perror_msg_and_die("fread filesystem image superblock"); if(swapit) - swap_badfs(fs); - if(fs->sb.s_rev_level || (fs->sb.s_magic != EXT2_MAGIC_NUMBER)) + swap_sb(fs->sb); + + if((fs->sb->s_rev_level > 1) || (fs->sb->s_magic != EXT2_MAGIC_NUMBER)) error_msg_and_die("not a suitable ext2 filesystem"); + if (fs->sb->s_rev_level > 0) { + if (fs->sb->s_first_ino != EXT2_GOOD_OLD_FIRST_INO) + error_msg_and_die("First inode incompatible"); + if (fs->sb->s_inode_size != EXT2_GOOD_OLD_INODE_SIZE) + error_msg_and_die("inode size incompatible"); + if (fs->sb->s_feature_compat) + error_msg_and_die("Unsupported compat features"); + if (fs->sb->s_feature_incompat) + error_msg_and_die("Unsupported incompat features"); + if (fs->sb->s_feature_ro_compat + & ~EXT2_FEATURE_RO_COMPAT_LARGE_FILE) + error_msg_and_die("Unsupported ro compat features"); + } + + set_file_size(fs); return fs; } static void free_fs(filesystem *fs) { + free(fs->hdlinks.hdl); + fclose(fs->f); + free(fs->sb); free(fs); } @@ -2123,16 +2812,23 @@ { blockwalker bw; uint32 bk; - int32 fsize = get_nod(fs, nod)->i_size; + nod_info *ni; + inode *node = get_nod(fs, nod, &ni); + int32 fsize = node->i_size; + blk_info *bi; + init_bw(&bw); while((bk = walk_bw(fs, nod, &bw, 0, 0)) != WALK_END) { if(fsize <= 0) error_msg_and_die("wrong size while saving inode %d", nod); - if(fwrite(get_blk(fs, bk), (fsize > BLOCKSIZE) ? BLOCKSIZE : fsize, 1, f) != 1) + if(fwrite(get_blk(fs, bk, &bi), + (fsize > BLOCKSIZE) ? BLOCKSIZE : fsize, 1, f) != 1) error_msg_and_die("error while saving inode %d", nod); + put_blk(bi); fsize -= BLOCKSIZE; } + put_nod(ni); } @@ -2141,8 +2837,11 @@ print_dev(filesystem *fs, uint32 nod) { int minor, major; - minor = ((uint8*)get_nod(fs, nod)->i_block)[0]; - major = ((uint8*)get_nod(fs, nod)->i_block)[1]; + nod_info *ni; + inode *node = get_nod(fs, nod, &ni); + minor = ((uint8*)node->i_block)[0]; + major = ((uint8*)node->i_block)[1]; + put_nod(ni); printf("major: %d, minor: %d\n", major, minor); } @@ -2157,17 +2856,15 @@ while((bk = walk_bw(fs, nod, &bw, 0, 0)) != WALK_END) { directory *d; - uint8 *b; - b = get_blk(fs, bk); - for(d = (directory*)b; (int8*)d + sizeof(*d) < (int8*)b + BLOCKSIZE; d = (directory*)((int8*)d + d->d_rec_len)) + dirwalker dw; + for (d = get_dir(fs, bk, &dw); d; d = next_dir(&dw)) if(d->d_inode) { - int i; printf("entry '"); - for(i = 0; i < d->d_name_len; i++) - putchar(d->d_name[i]); + fwrite(dir_name(&dw), 1, d->d_name_len, stdout); printf("' (inode %d): rec_len: %d (name_len: %d)\n", d->d_inode, d->d_rec_len, d->d_name_len); } + put_dir(&dw); } } @@ -2175,14 +2872,18 @@ static void print_link(filesystem *fs, uint32 nod) { - if(!get_nod(fs, nod)->i_blocks) - printf("links to '%s'\n", (char*)get_nod(fs, nod)->i_block); + nod_info *ni; + inode *node = get_nod(fs, nod, &ni); + + if(!node->i_blocks) + printf("links to '%s'\n", (char*)node->i_block); else { printf("links to '"); write_blocks(fs, nod, stdout); printf("'\n"); } + put_nod(ni); } // make a ls-like printout of permissions @@ -2251,8 +2952,13 @@ { char *s; char perms[11]; - if(!get_nod(fs, nod)->i_mode) - return; + nod_info *ni; + inode *node = get_nod(fs, nod, &ni); + blk_info *bi; + gd_info *gi; + + if(!node->i_mode) + goto out; switch(nod) { case EXT2_BAD_INO: @@ -2274,15 +2980,18 @@ default: s = (nod >= EXT2_FIRST_INO) ? "normal" : "unknown reserved"; } - printf("inode %d (%s, %d links): ", nod, s, get_nod(fs, nod)->i_links_count); - if(!allocated(GRP_GET_INODE_BITMAP(fs,nod), GRP_IBM_OFFSET(fs,nod))) + printf("inode %d (%s, %d links): ", nod, s, node->i_links_count); + if(!allocated(GRP_GET_INODE_BITMAP(fs,nod,&bi,&gi), GRP_IBM_OFFSET(fs,nod))) { + GRP_PUT_INODE_BITMAP(bi,gi); printf("unallocated\n"); - return; + goto out; } - make_perms(get_nod(fs, nod)->i_mode, perms); - printf("%s, size: %d byte%s (%d block%s)\n", perms, plural(get_nod(fs, nod)->i_size), plural(get_nod(fs, nod)->i_blocks / INOBLK)); - switch(get_nod(fs, nod)->i_mode & FM_IFMT) + GRP_PUT_INODE_BITMAP(bi,gi); + make_perms(node->i_mode, perms); + printf("%s, size: %d byte%s (%d block%s)\n", perms, + plural(node->i_size), plural(node->i_blocks / INOBLK)); + switch(node->i_mode & FM_IFMT) { case FM_IFSOCK: list_blocks(fs, nod); @@ -2310,6 +3019,8 @@ list_blocks(fs, nod); } printf("Done with inode %d\n",nod); +out: + put_nod(ni); } // describes various fields in a filesystem @@ -2317,49 +3028,65 @@ print_fs(filesystem *fs) { uint32 i; + blk_info *bi; + groupdescriptor *gd; + gd_info *gi; uint8 *ibm; printf("%d blocks (%d free, %d reserved), first data block: %d\n", - fs->sb.s_blocks_count, fs->sb.s_free_blocks_count, - fs->sb.s_r_blocks_count, fs->sb.s_first_data_block); - printf("%d inodes (%d free)\n", fs->sb.s_inodes_count, - fs->sb.s_free_inodes_count); + fs->sb->s_blocks_count, fs->sb->s_free_blocks_count, + fs->sb->s_r_blocks_count, fs->sb->s_first_data_block); + printf("%d inodes (%d free)\n", fs->sb->s_inodes_count, + fs->sb->s_free_inodes_count); printf("block size = %d, frag size = %d\n", - fs->sb.s_log_block_size ? (fs->sb.s_log_block_size << 11) : 1024, - fs->sb.s_log_frag_size ? (fs->sb.s_log_frag_size << 11) : 1024); + fs->sb->s_log_block_size ? (fs->sb->s_log_block_size << 11) : 1024, + fs->sb->s_log_frag_size ? (fs->sb->s_log_frag_size << 11) : 1024); printf("number of groups: %d\n",GRP_NBGROUPS(fs)); printf("%d blocks per group,%d frags per group,%d inodes per group\n", - fs->sb.s_blocks_per_group, fs->sb.s_frags_per_group, - fs->sb.s_inodes_per_group); + fs->sb->s_blocks_per_group, fs->sb->s_frags_per_group, + fs->sb->s_inodes_per_group); printf("Size of inode table: %d blocks\n", - (int)(fs->sb.s_inodes_per_group * sizeof(inode) / BLOCKSIZE)); + (int)(fs->sb->s_inodes_per_group * sizeof(inode) / BLOCKSIZE)); for (i = 0; i < GRP_NBGROUPS(fs); i++) { printf("Group No: %d\n", i+1); + gd = get_gd(fs, i, &gi); printf("block bitmap: block %d,inode bitmap: block %d, inode table: block %d\n", - fs->gd[i].bg_block_bitmap, fs->gd[i].bg_inode_bitmap, - fs->gd[i].bg_inode_table); + gd->bg_block_bitmap, + gd->bg_inode_bitmap, + gd->bg_inode_table); printf("block bitmap allocation:\n"); - print_bm(GRP_GET_GROUP_BBM(fs, i),fs->sb.s_blocks_per_group); + print_bm(GRP_GET_GROUP_BBM(fs, gd, &bi),fs->sb->s_blocks_per_group); + GRP_PUT_GROUP_BBM(bi); printf("inode bitmap allocation:\n"); - ibm = GRP_GET_GROUP_IBM(fs, i); - print_bm(ibm, fs->sb.s_inodes_per_group); - for (i = 1; i <= fs->sb.s_inodes_per_group; i++) + ibm = GRP_GET_GROUP_IBM(fs, gd, &bi); + print_bm(ibm, fs->sb->s_inodes_per_group); + for (i = 1; i <= fs->sb->s_inodes_per_group; i++) if (allocated(ibm, i)) print_inode(fs, i); + GRP_PUT_GROUP_IBM(bi); + put_gd(gi); } } static void -dump_fs(filesystem *fs, FILE * fh, int swapit) +finish_fs(filesystem *fs) { - uint32 nbblocks = fs->sb.s_blocks_count; - fs->sb.s_reserved[200] = 0; - if(swapit) - swap_goodfs(fs); - if(fwrite(fs, BLOCKSIZE, nbblocks, fh) < nbblocks) - perror_msg_and_die("output filesystem image"); - if(swapit) - swap_badfs(fs); + if (cache_flush(&fs->inodes)) + error_msg_and_die("entry mismatch on inode cache flush"); + if (cache_flush(&fs->blkmaps)) + error_msg_and_die("entry mismatch on blockmap cache flush"); + if (cache_flush(&fs->gds)) + error_msg_and_die("entry mismatch on gd cache flush"); + if (cache_flush(&fs->blks)) + error_msg_and_die("entry mismatch on block cache flush"); + if(fs->swapit) + swap_sb(fs->sb); + if (fseek(fs->f, SUPERBLOCK_OFFSET, SEEK_SET)) + perror_msg_and_die("fseek"); + if(fwrite(fs->sb, SUPERBLOCK_SIZE, 1, fs->f) != 1) + perror_msg_and_die("output filesystem superblock"); + if(fs->swapit) + swap_sb(fs->sb); } static void @@ -2419,10 +3146,12 @@ " -x, --starting-image <image>\n" " -d, --root <directory>\n" " -D, --devtable <file>\n" + " -B, --block-size <bytes>\n" " -b, --size-in-blocks <blocks>\n" " -i, --bytes-per-inode <bytes per inode>\n" " -N, --number-of-inodes <number of inodes>\n" " -m, --reserved-percentage <percentage of blocks to reserve>\n" + " -o, --creator-os <os> 'linux' (default), 'hurd', 'freebsd' or number.\n" " -g, --block-map <path> Generate a block map file for this path.\n" " -e, --fill-value <value> Fill unallocated blocks with value.\n" " -z, --allow-holes Allow files with holes.\n" @@ -2444,15 +3173,34 @@ extern char* optarg; extern int optind, opterr, optopt; +// parse the value for -o <os> +int +lookup_creator_os(const char *name) +{ + if (isdigit (*name)) + return atoi(name); + else if (strcasecmp(name, "linux") == 0) + return EXT2_OS_LINUX; + else if (strcasecmp(name, "GNU") == 0 || strcasecmp(name, "hurd") == 0) + return EXT2_OS_HURD; + else if (strcasecmp(name, "freebsd") == 0) + return EXT2_OS_FREEBSD; + else if (strcasecmp(name, "lites") == 0) + return EXT2_OS_LITES; + else + return EXT2_OS_LINUX; +} + int main(int argc, char **argv) { - int nbblocks = -1; + long long nbblocks = -1; int nbinodes = -1; int nbresrvd = -1; float bytes_per_inode = -1; float reserved_frac = -1; int fs_timestamp = -1; + int creator_os = CREATOR_OS; char * fsout = "-"; char * fsin = 0; char * dopt[MAX_DOPT]; @@ -2466,6 +3214,7 @@ int squash_perms = 0; uint16 endian = 1; int bigendian = !*(char*)&endian; + char *volumelabel = NULL; filesystem *fs; int i; int c; @@ -2476,13 +3225,16 @@ { "starting-image", required_argument, NULL, 'x' }, { "root", required_argument, NULL, 'd' }, { "devtable", required_argument, NULL, 'D' }, + { "block-size", required_argument, NULL, 'B' }, { "size-in-blocks", required_argument, NULL, 'b' }, { "bytes-per-inode", required_argument, NULL, 'i' }, { "number-of-inodes", required_argument, NULL, 'N' }, + { "volume-label", required_argument, NULL, 'L' }, { "reserved-percentage", required_argument, NULL, 'm' }, + { "creator-os", required_argument, NULL, 'o' }, { "block-map", required_argument, NULL, 'g' }, { "fill-value", required_argument, NULL, 'e' }, - { "allow-holes", no_argument, NULL, 'z' }, + { "allow-holes", no_argument, NULL, 'z' }, { "faketime", no_argument, NULL, 'f' }, { "squash", no_argument, NULL, 'q' }, { "squash-uids", no_argument, NULL, 'U' }, @@ -2495,11 +3247,11 @@ app_name = argv[0]; - while((c = getopt_long(argc, argv, "x:d:D:b:i:N:m:g:e:zfqUPhVv", longopts, NULL)) != EOF) { + while((c = getopt_long(argc, argv, "x:d:D:B:b:i:N:L:m:o:g:e:zfqUPhVv", longopts, NULL)) != EOF) { #else app_name = argv[0]; - while((c = getopt(argc, argv, "x:d:D:b:i:N:m:g:e:zfqUPhVv")) != EOF) { + while((c = getopt(argc, argv, "x:d:D:B:b:i:N:L:m:o:g:e:zfqUPhVv")) != EOF) { #endif /* HAVE_GETOPT_LONG */ switch(c) { @@ -2510,6 +3262,9 @@ case 'D': dopt[didx++] = optarg; break; + case 'B': + blocksize = SI_atof(optarg); + break; case 'b': nbblocks = SI_atof(optarg); break; @@ -2519,9 +3274,15 @@ case 'N': nbinodes = SI_atof(optarg); break; + case 'L': + volumelabel = optarg; + break; case 'm': reserved_frac = SI_atof(optarg) / 100; break; + case 'o': + creator_os = lookup_creator_os(optarg); + break; case 'g': gopt[gidx++] = optarg; break; @@ -2565,21 +3326,21 @@ error_msg_and_die("Not enough arguments. Try --help or else see the man page."); fsout = argv[optind]; - hdlinks.hdl = (struct hdlink_s *)malloc(hdlink_cnt * sizeof(struct hdlink_s)); - if (!hdlinks.hdl) - error_msg_and_die("Not enough memory"); - hdlinks.count = 0 ; + if(blocksize != 1024 && blocksize != 2048 && blocksize != 4096) + error_msg_and_die("Valid block sizes: 1024, 2048 or 4096."); + if(creator_os < 0) + error_msg_and_die("Creator OS unknown."); if(fsin) { if(strcmp(fsin, "-")) { FILE * fh = xfopen(fsin, "rb"); - fs = load_fs(fh, bigendian); + fs = load_fs(fh, bigendian, fsout); fclose(fh); } else - fs = load_fs(stdin, bigendian); + fs = load_fs(stdin, bigendian, fsout); } else { @@ -2609,16 +3370,29 @@ } if(fs_timestamp == -1) fs_timestamp = time(NULL); - fs = init_fs(nbblocks, nbinodes, nbresrvd, holes, fs_timestamp); + fs = init_fs(nbblocks, nbinodes, nbresrvd, holes, + fs_timestamp, creator_os, bigendian, fsout); } + if (volumelabel != NULL) + strncpy((char *)fs->sb->s_volume_name, volumelabel, + sizeof(fs->sb->s_volume_name)); populate_fs(fs, dopt, didx, squash_uids, squash_perms, fs_timestamp, NULL); if(emptyval) { uint32 b; - for(b = 1; b < fs->sb.s_blocks_count; b++) - if(!allocated(GRP_GET_BLOCK_BITMAP(fs,b),GRP_BBM_OFFSET(fs,b))) - memset(get_blk(fs, b), emptyval, BLOCKSIZE); + for(b = 1; b < fs->sb->s_blocks_count; b++) { + blk_info *bi; + gd_info *gi; + if(!allocated(GRP_GET_BLOCK_BITMAP(fs,b,&bi,&gi), + GRP_BBM_OFFSET(fs,b))) { + blk_info *bi2; + memset(get_blk(fs, b, &bi2), emptyval, + BLOCKSIZE); + put_blk(bi2); + } + GRP_PUT_BLOCK_BITMAP(bi,gi); + } } if(verbose) print_fs(fs); @@ -2628,24 +3402,22 @@ char fname[MAX_FILENAME]; char *p; FILE *fh; + nod_info *ni; if(!(nod = find_path(fs, EXT2_ROOT_INO, gopt[i]))) error_msg_and_die("path %s not found in filesystem", gopt[i]); while((p = strchr(gopt[i], '/'))) *p = '_'; SNPRINTF(fname, MAX_FILENAME-1, "%s.blk", gopt[i]); fh = xfopen(fname, "wb"); - fprintf(fh, "%d:", get_nod(fs, nod)->i_size); + fprintf(fh, "%d:", get_nod(fs, nod, &ni)->i_size); + put_nod(ni); flist_blocks(fs, nod, fh); fclose(fh); } - if(strcmp(fsout, "-")) - { - FILE * fh = xfopen(fsout, "wb"); - dump_fs(fs, fh, bigendian); - fclose(fh); - } - else - dump_fs(fs, stdout, bigendian); + finish_fs(fs); + if(strcmp(fsout, "-") == 0) + copy_file(fs, stdout, fs->f, fs->sb->s_blocks_count); + free_fs(fs); return 0; } Index: genext2fs-1.4.1/cache.h =================================================================== --- /dev/null +++ genext2fs-1.4.1/cache.h @@ -0,0 +1,128 @@ +#ifndef __CACHE_H__ +#define __CACHE_H__ + +#include "list.h" + +#define CACHE_LISTS 256 + +typedef struct +{ + list_elem link; + list_elem lru_link; +} cache_link; + +typedef struct +{ + /* LRU list holds unused items */ + unsigned int lru_entries; + list_elem lru_list; + unsigned int max_free_entries; + + unsigned int entries; + list_elem lists[CACHE_LISTS]; + unsigned int (*elem_val)(cache_link *elem); + void (*freed)(cache_link *elem); +} listcache; + +static inline void +cache_add(listcache *c, cache_link *elem) +{ + unsigned int hash = c->elem_val(elem) % CACHE_LISTS; + int delcount = c->lru_entries - c->max_free_entries; + + if (delcount > 0) { + /* Delete some unused items. */ + list_elem *lru, *next; + cache_link *l; + list_for_each_elem_safe(&c->lru_list, lru, next) { + l = container_of(lru, cache_link, lru_link); + list_del(lru); + list_del(&l->link); + c->entries--; + c->lru_entries--; + c->freed(l); + delcount--; + if (delcount <= 0) + break; + } + } + + c->entries++; + list_item_init(&elem->lru_link); /* Mark it not in the LRU list */ + list_add_after(&c->lists[hash], &elem->link); +} + +static inline void +cache_item_set_unused(listcache *c, cache_link *elem) +{ + list_add_before(&c->lru_list, &elem->lru_link); + c->lru_entries++; +} + +static inline cache_link * +cache_find(listcache *c, unsigned int val) +{ + unsigned int hash = val % CACHE_LISTS; + list_elem *elem; + + list_for_each_elem(&c->lists[hash], elem) { + cache_link *l = container_of(elem, cache_link, link); + if (c->elem_val(l) == val) { + if (!list_empty(&l->lru_link)) { + /* It's in the unused list, remove it. */ + list_del(&l->lru_link); + list_item_init(&l->lru_link); + c->lru_entries--; + } + return l; + } + } + return NULL; +} + +static inline int +cache_flush(listcache *c) +{ + list_elem *elem, *next; + cache_link *l; + int i; + + list_for_each_elem_safe(&c->lru_list, elem, next) { + l = container_of(elem, cache_link, lru_link); + list_del(elem); + list_del(&l->link); + c->entries--; + c->lru_entries--; + c->freed(l); + } + + for (i = 0; i < CACHE_LISTS; i++) { + list_for_each_elem_safe(&c->lists[i], elem, next) { + l = container_of(elem, cache_link, link); + list_del(&l->link); + c->entries--; + c->freed(l); + } + } + + return c->entries || c->lru_entries; +} + +static inline void +cache_init(listcache *c, unsigned int max_free_entries, + unsigned int (*elem_val)(cache_link *elem), + void (*freed)(cache_link *elem)) +{ + int i; + + c->entries = 0; + c->lru_entries = 0; + c->max_free_entries = max_free_entries; + list_init(&c->lru_list); + for (i = 0; i < CACHE_LISTS; i++) + list_init(&c->lists[i]); + c->elem_val = elem_val; + c->freed = freed; +} + +#endif /* __CACHE_H__ */ Index: genext2fs-1.4.1/list.h =================================================================== --- /dev/null +++ genext2fs-1.4.1/list.h @@ -0,0 +1,78 @@ +#ifndef __LIST_H__ +#define __LIST_H__ + +#if STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# if HAVE_STDLIB_H +# include <stdlib.h> +# endif +# if HAVE_STDDEF_H +# include <stddef.h> +# endif +#endif + +#ifndef offsetof +#define offsetof(st, m) \ + ((size_t) ( (char *)&((st *)(0))->m - (char *)0 )) +#endif + +#define container_of(ptr, type, member) ({ \ + const typeof( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) + +typedef struct list_elem +{ + struct list_elem *next; + struct list_elem *prev; +} list_elem; + +static inline void list_init(list_elem *list) +{ + list->next = list; + list->prev = list; +} + +static inline void list_add_after(list_elem *pos, list_elem *elem) +{ + elem->next = pos->next; + elem->prev = pos; + pos->next->prev = elem; + pos->next = elem; +} + +static inline void list_add_before(list_elem *pos, list_elem *elem) +{ + elem->prev = pos->prev; + elem->next = pos; + pos->prev->next = elem; + pos->prev = elem; +} + +static inline void list_del(list_elem *elem) +{ + elem->next->prev = elem->prev; + elem->prev->next = elem->next; +} + +static inline void list_item_init(list_elem *elem) +{ + elem->next = elem; + elem->prev = elem; +} + +static inline int list_empty(list_elem *elem) +{ + return elem->next == elem; +} + +#define list_for_each_elem(list, curr) \ + for ((curr) = (list)->next; (curr) != (list); (curr) = (curr)->next) + +#define list_for_each_elem_safe(list, curr, next) \ + for ((curr) = (list)->next, (next) = (curr)->next; \ + (curr) != (list); \ + (curr) = (next), (next) = (curr)->next) + +#endif /* __LIST_H__ */
shibajee/buildroot
package/genext2fs/0001-update-genext2fs.c-to-rev-1.118.patch
patch
mit
87,319
config BR2_PACKAGE_GENEXT2FS bool "genext2fs" help genext2fs generates an ext2 filesystem as a normal (non-root) user. It does not require you to mount the image file to copy files on it, nor does it require that you become the superuser to make device nodes. http://genext2fs.sourceforge.net/
shibajee/buildroot
package/genext2fs/Config.in
in
mit
312
config BR2_PACKAGE_HOST_GENEXT2FS bool "host genext2fs" help genext2fs generates an ext2 filesystem as a normal (non-root) user. It does not require you to mount the image file to copy files on it, nor does it require that you become the superuser to make device nodes. http://genext2fs.sourceforge.net/
shibajee/buildroot
package/genext2fs/Config.in.host
host
mit
323
# Locally computed: sha256 404dbbfa7a86a6c3de8225c8da254d026b17fd288e05cec4df2cc7e1f4feecfc genext2fs-1.4.1.tar.gz
shibajee/buildroot
package/genext2fs/genext2fs.hash
hash
mit
117
################################################################################ # # genext2fs # ################################################################################ GENEXT2FS_VERSION = 1.4.1 GENEXT2FS_SITE = http://downloads.sourceforge.net/project/genext2fs/genext2fs/$(GENEXT2FS_VERSION) GENEXT2FS_LICENSE = GPLv2 GENEXT2FS_LICENSE_FILES = COPYING $(eval $(autotools-package)) $(eval $(host-autotools-package))
shibajee/buildroot
package/genext2fs/genext2fs.mk
mk
mit
428
# Locally computed sha256 30b05a88604d71ef2a42a2ef26cd26df242b41f5b011ad03083143a31d9b01f7 gengetopt-2.22.6.tar.gz
shibajee/buildroot
package/gengetopt/gengetopt.hash
hash
mit
115
################################################################################ # # gengetopt # ################################################################################ GENGETOPT_VERSION = 2.22.6 GENGETOPT_SITE = $(BR2_GNU_MIRROR)/gengetopt GENGETOPT_LICENSE = GPLv3+ GENGETOPT_LICENSE_FILES = COPYING LICENSE # Parallel build broken GENGETOPT_MAKE = $(MAKE1) $(eval $(host-autotools-package))
shibajee/buildroot
package/gengetopt/gengetopt.mk
mk
mit
406
config BR2_PACKAGE_HOST_GENIMAGE bool "host genimage" help genimage is a tool to generate multiple filesystem and flash images from a given root filesystem tree. genimage is intended to be run in a fakeroot environment. Configuration is done is a config file parsed by libconfuse. Options like the path to tools can be given in environment variables, the config file or commandline switches. http://www.pengutronix.de/software/genimage/
shibajee/buildroot
package/genimage/Config.in.host
host
mit
465
# Locally calculated sha256 363b2222b8036eca927c464994e7a877539adc3ea9ba895c1e2186f0589fafbf genimage-8.tar.xz
shibajee/buildroot
package/genimage/genimage.hash
hash
mit
111
################################################################################ # # genimage # ################################################################################ GENIMAGE_VERSION = 8 GENIMAGE_SOURCE = genimage-$(GENIMAGE_VERSION).tar.xz GENIMAGE_SITE = http://www.pengutronix.de/software/genimage/download HOST_GENIMAGE_DEPENDENCIES = host-pkgconf host-libconfuse GENIMAGE_LICENSE = GPLv2 $(eval $(host-autotools-package))
shibajee/buildroot
package/genimage/genimage.mk
mk
mit
440
genpart: return 0 if partition writen OK, with no do_magic If do_magic is false, we don't won't write the 0xaa55 magic. However, if we succesfully wrote the partition entry, we still want to return 0 to indicate success. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Robert Schwebel <r.schwebel@pengutronix.de> -- Patch sent upstream, but no mailing list. Status: accepted upstream, not yet released. diff -durN host-genpart-1.0.2.orig/src/genpart.c host-genpart-1.0.2/src/genpart.c --- host-genpart-1.0.2.orig/src/genpart.c 2009-12-20 21:54:56.000000000 +0100 +++ host-genpart-1.0.2/src/genpart.c 2013-01-22 23:13:24.109752579 +0100 @@ -92,6 +92,8 @@ if (do_magic) { if (fwrite(&magic, 2, 1, stdout) > 0) rc=0; + } else { + rc=0; } } return rc;
shibajee/buildroot
package/genpart/0001-fix-return-code.patch
patch
mit
787
config BR2_PACKAGE_GENPART bool "genpart" help Generate a 16 byte partition table entry defined by command line arguments and dump it to stdout. No CHS magic is done, only lba entries are filled out. http://www.pengutronix.de/software/genpart/index_en.html
shibajee/buildroot
package/genpart/Config.in
in
mit
272
config BR2_PACKAGE_HOST_GENPART bool "host genpart" help Generate a 16 byte partition table entry defined by command line arguments and dump it to stdout. No CHS magic is done, only lba entries are filled out. http://www.pengutronix.de/software/genpart/index_en.html
shibajee/buildroot
package/genpart/Config.in.host
host
mit
282
# Locally calculated sha256 bfb39434f31d10f1b8c7b6bc6ec612309838c2819022561541c4d2d5a424e3f2 genpart-1.0.2.tar.bz2
shibajee/buildroot
package/genpart/genpart.hash
hash
mit
115
################################################################################ # # genpart # ################################################################################ GENPART_VERSION = 1.0.2 GENPART_SOURCE = genpart-$(GENPART_VERSION).tar.bz2 GENPART_SITE = http://www.pengutronix.de/software/genpart/download # genpart has no license embedded in its source release. # However, their project page mentions: # > This community portal offers an overview about our own OSS # > projects and projects Pengutronix is or was involved with. # We can thus assume genpart is under a FLOSS license. # So, until the authors have clarified the licensing terms: GENPART_LICENSE = Unknown (clarification has been asked to the authors) $(eval $(autotools-package)) $(eval $(host-autotools-package))
shibajee/buildroot
package/genpart/genpart.mk
mk
mit
798
--- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) Index: genromfs-0.5.2/Makefile =================================================================== --- genromfs-0.5.2.orig/Makefile +++ genromfs-0.5.2/Makefile @@ -6,8 +6,6 @@ PACKAGE = genromfs VERSION = 0.5.2 CC = gcc -CFLAGS = -O2 -Wall -DVERSION=\"$(VERSION)\"#-g# -LDFLAGS = -s#-g DISTDIR = $(PACKAGE)-$(VERSION) @@ -24,7 +22,7 @@ $(CC) $(LDFLAGS) genromfs.o -o genromfs .c.o: - $(CC) $(CFLAGS) $< -c -o $@ + $(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" $< -c -o $@ clean: rm -f genromfs *.o
shibajee/buildroot
package/genromfs/0001-build-system.patch
patch
mit
586
config BR2_PACKAGE_GENROMFS bool "genromfs" help Tool to generate a ROMFS filesystem. http://romfs.sourceforge.net/
shibajee/buildroot
package/genromfs/Config.in
in
mit
125
# Locally computed: sha256 30f37fc734572c1dbaa2504585bc23ba6b8fd7df767ae7155995b2ca0ebed960 genromfs-0.5.2.tar.gz
shibajee/buildroot
package/genromfs/genromfs.hash
hash
mit
116
################################################################################ # # genromfs # ################################################################################ GENROMFS_VERSION = 0.5.2 GENROMFS_SITE = http://downloads.sourceforge.net/project/romfs/genromfs/$(GENROMFS_VERSION) GENROMFS_LICENSE = GPLv2+ GENROMFS_LICENSE_FILES = COPYING define GENROMFS_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \ CC="$(TARGET_CC)" \ CFLAGS="$(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" endef define GENROMFS_INSTALL_TARGET_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX=$(TARGET_DIR) install endef define HOST_GENROMFS_BUILD_CMDS $(HOST_MAKE_ENV) $(MAKE) -C $(@D) endef define HOST_GENROMFS_INSTALL_CMDS $(HOST_MAKE_ENV) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR) install endef $(eval $(generic-package)) $(eval $(host-generic-package))
shibajee/buildroot
package/genromfs/genromfs.mk
mk
mit
855
config BR2_PACKAGE_GEOIP bool "geoip" help GeoIP is a C library that enables the user to find geographical and network information of an IP address. To use this library, you need to download MaxMind's free GeoLite or commercial GeoIP binary databases into the target's /usr/share/GeoIP directory in uncompressed form. Note that GeoIP2 / GeoLite2 are not supported by this library. https://github.com/maxmind/geoip-api-c
shibajee/buildroot
package/geoip/Config.in
in
mit
449
# Locally calculated sha256 4b446491843de67c1af9b887da17a3e5939e0aeed4826923a5f4bf09d845096f GeoIP-1.6.9.tar.gz
shibajee/buildroot
package/geoip/geoip.hash
hash
mit
114
################################################################################ # # geoip # ################################################################################ GEOIP_VERSION = 1.6.9 GEOIP_SOURCE = GeoIP-$(GEOIP_VERSION).tar.gz GEOIP_SITE = https://github.com/maxmind/geoip-api-c/releases/download/v$(GEOIP_VERSION) GEOIP_INSTALL_STAGING = YES GEOIP_LICENSE = LGPLv2.1+ GEOIP_LICENSE_FILES = COPYING $(eval $(autotools-package))
shibajee/buildroot
package/geoip/geoip.mk
mk
mit
444
config BR2_PACKAGE_GESFTPSERVER bool "gesftpserver" select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE depends on BR2_USE_WCHAR depends on BR2_TOOLCHAIN_HAS_THREADS depends on BR2_USE_MMU # fork() help Green End SFTP Server This is an SFTP server supporting up to protocol version 6. It is possible to use it as a drop-in replacement for the OpenSSH server, or to provide sftp support for Dropbear. http://www.greenend.org.uk/rjk/sftpserver/ comment "gesftpserver needs a toolchain w/ wchar, threads" depends on BR2_USE_MMU depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
shibajee/buildroot
package/gesftpserver/Config.in
in
mit
605
# Locally calculated sha256 5f744c38df9bb82f5ab500858a0fb4767ac3ee2254301da03cbcf8e6c587cbf5 sftpserver-0.2.1.tar.gz
shibajee/buildroot
package/gesftpserver/gesftpserver.hash
hash
mit
117
################################################################################ # # gesftpserver # ################################################################################ GESFTPSERVER_VERSION = 0.2.1 GESFTPSERVER_SOURCE = sftpserver-$(GESFTPSERVER_VERSION).tar.gz GESFTPSERVER_SITE = http://www.greenend.org.uk/rjk/sftpserver GESFTPSERVER_LICENSE = GPLv2+ GESFTPSERVER_LICENSE_FILES = COPYING # forgets to link against pthread when cross compiling GESFTPSERVER_CONF_ENV = LIBS=-lpthread # overwrite openssh version if enabled GESFTPSERVER_DEPENDENCIES += \ $(if $(BR2_ENABLE_LOCALE),,libiconv) \ $(if $(BR2_PACKAGE_OPENSSH),openssh) # openssh/dropbear looks here define GESFTPSERVER_ADD_SYMLINK ln -sf gesftpserver $(TARGET_DIR)/usr/libexec/sftp-server endef GESFTPSERVER_POST_INSTALL_TARGET_HOOKS += GESFTPSERVER_ADD_SYMLINK $(eval $(autotools-package))
shibajee/buildroot
package/gesftpserver/gesftpserver.mk
mk
mit
873
config BR2_PACKAGE_GETENT bool "getent" help This package installs the 'getent' utility, which allows to get entries from Name Service Switch libraries. For glibc toolchains, it's the real getent program from the C library that gets installed, which is NSS-capable. For uclibc and musl toolchains, it's a simple wrapper script that emulates getent's behavior, since there is no NSS support in uclibc and musl.
shibajee/buildroot
package/getent/Config.in
in
mit
433
#!/bin/sh # $Header: /var/cvs/uClibc/extra/scripts/getent,v 1.2 2005/02/02 14:18:01 solar Exp $ # # Closely (not perfectly) emulate the behavior of glibc's getent utility # #passwd|shadow|group|aliases|hosts|networks|ethers|netgroup|protocols|services|rpc # only returns the first match (by design) # dns based search is not supported (hosts,networks) # case-insensitive matches not supported (ethers; others?) # may return false-positives (hosts,protocols,rpc,services,ethers) # # Taken from uClibc 0.9.33. export PATH="${PATH}:/bin:/usr/bin" file="/etc/$1" case $1 in passwd|group) match="^$2:\|^[^:]*:[^:]*:$2:" ;; shadow) match="^$2:" ;; networks|netgroup) match="^[[:space:]]*$2\>" ;; hosts|protocols|rpc|services|ethers) match="\<$2\>" ;; aliases) match="^[[:space:]]*$2[[:space:]]*:" ;; ""|-h|--help) echo "USAGE: $0 database [key]" exit 0 ;; *) echo "$0: Unknown database: $1" 1>&2 exit 1 ;; esac if [ ! -f "$file" ] ; then echo "$0: Could not find database file for $1" 1>&2 exit 1 fi if [ $# -eq 1 ] ; then exec cat "$file" else sed "s/#.*//; /$match/q; d" "$file" | grep . || exit 2 fi
shibajee/buildroot
package/getent/getent
none
mit
1,130
################################################################################ # # getent # ################################################################################ GETENT_LICENSE = LGPLv2.1+ # For glibc toolchains, we use the getent program built/installed by # the C library. For other toolchains, we use the wrapper script # included in this package. ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y) # Sourcery toolchains install it in sysroot/usr/lib/bin # Buildroot toolchains install it in sysroot/usr/bin GETENT_LOCATION = $(firstword $(wildcard \ $(STAGING_DIR)/usr/bin/getent \ $(STAGING_DIR)/usr/lib/bin/getent)) else GETENT_LOCATION = package/getent/getent endif define GETENT_INSTALL_TARGET_CMDS $(INSTALL) -D -m 0755 $(GETENT_LOCATION) $(TARGET_DIR)/usr/bin/getent endef $(eval $(generic-package))
shibajee/buildroot
package/getent/getent.mk
mk
mit
816
--- gettext-0.16.1.oorig/gettext-tools/gnulib-lib/error.h 2006-11-27 18:14:50.000000000 +0100 +++ gettext-0.16.1/gettext-tools/gnulib-lib/error.h 2007-06-20 13:29:32.000000000 +0200 @@ -50,7 +50,10 @@ extern void error_at_line (int __status, /* If NULL, error will flush stdout, then print on stderr the program name, a colon and a space. Otherwise, error will call this function without parameters instead. */ -extern DLL_VARIABLE void (*error_print_progname) (void); +#ifndef __UCLIBC__ +extern DLL_VARIABLE +#endif +void (*error_print_progname) (void); /* This variable is incremented each time `error' is called. */ extern DLL_VARIABLE unsigned int error_message_count;
shibajee/buildroot
package/gettext/0001-error_print_progname.patch
patch
mit
690
config BR2_PACKAGE_GETTEXT bool "gettext" depends on BR2_USE_WCHAR help The GNU `gettext' utilities are a set of tools that provide a framework to help other GNU packages produce multi-lingual messages. Only the libintl library will be installed in the target. The full gettext suite, including tools, will be installed in the staging directory. http://www.gnu.org/software/gettext/ comment "gettext needs a toolchain w/ wchar" depends on BR2_NEEDS_GETTEXT depends on !BR2_USE_WCHAR
shibajee/buildroot
package/gettext/Config.in
in
mit
512
# From http://lists.gnu.org/archive/html/bug-gettext/2016-06/msg00008.html md5 df3f5690eaa30fd228537b00cb7b7590 gettext-0.19.8.1.tar.xz sha1 e0fe90ede22f7f16bbde7bdea791a835f2773fc9 gettext-0.19.8.1.tar.xz
shibajee/buildroot
package/gettext/gettext.hash
hash
mit
206
################################################################################ # # gettext # ################################################################################ GETTEXT_VERSION = 0.19.8.1 GETTEXT_SITE = $(BR2_GNU_MIRROR)/gettext GETTEXT_SOURCE = gettext-$(GETTEXT_VERSION).tar.xz GETTEXT_INSTALL_STAGING = YES GETTEXT_LICENSE = LGPLv2.1+ (libintl), GPLv3+ (the rest) GETTEXT_LICENSE_FILES = COPYING gettext-runtime/intl/COPYING.LIB GETTEXT_DEPENDENCIES = $(if $(BR2_PACKAGE_LIBICONV),libiconv) # Avoid using the bundled subset of libxml2 HOST_GETTEXT_DEPENDENCIES = host-libxml2 GETTEXT_CONF_OPTS += \ --disable-libasprintf \ --disable-acl \ --disable-openmp \ --disable-rpath \ --disable-java \ --disable-native-java \ --disable-csharp \ --disable-relocatable \ --without-emacs HOST_GETTEXT_CONF_OPTS = \ --disable-libasprintf \ --disable-acl \ --disable-openmp \ --disable-rpath \ --disable-java \ --disable-native-java \ --disable-csharp \ --disable-relocatable \ --without-emacs # For the target version, we only need the runtime, and for the host # version, we only need the tools. GETTEXT_SUBDIR = gettext-runtime HOST_GETTEXT_SUBDIR = gettext-tools # Disable the build of documentation and examples of gettext-tools, # and the build of documentation and tests of gettext-runtime. define HOST_GETTEXT_DISABLE_UNNEEDED $(SED) '/^SUBDIRS/s/ doc //;/^SUBDIRS/s/examples$$//' $(@D)/gettext-tools/Makefile.in $(SED) '/^SUBDIRS/s/ doc //;/^SUBDIRS/s/tests$$//' $(@D)/gettext-runtime/Makefile.in endef GETTEXT_POST_PATCH_HOOKS += HOST_GETTEXT_DISABLE_UNNEEDED HOST_GETTEXT_POST_PATCH_HOOKS += HOST_GETTEXT_DISABLE_UNNEEDED define GETTEXT_REMOVE_UNNEEDED $(RM) -rf $(TARGET_DIR)/usr/share/gettext/ABOUT-NLS rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/gettext endef GETTEXT_POST_INSTALL_TARGET_HOOKS += GETTEXT_REMOVE_UNNEEDED # Force build with NLS support, otherwise libintl is not built # This is needed because some packages (eg. libglib2) requires # locales, but do not properly depend on BR2_ENABLE_LOCALE, and # instead select BR2_PACKAGE_GETTEXT. Those packages need to be # fixed before we can remove the following 3 lines... :-( ifeq ($(BR2_ENABLE_LOCALE),) GETTEXT_CONF_OPTS += --enable-nls endif # Disable interactive confirmation in host gettextize for package fixups define HOST_GETTEXT_GETTEXTIZE_CONFIRMATION $(SED) '/read dummy/d' $(HOST_DIR)/usr/bin/gettextize endef HOST_GETTEXT_POST_INSTALL_HOOKS += HOST_GETTEXT_GETTEXTIZE_CONFIRMATION # autoreconf expects gettextize to install ABOUT-NLS, but it only gets # installed by gettext-runtime which we don't build/install for the # host, so do it manually define HOST_GETTEXT_ADD_ABOUT_NLS $(INSTALL) -m 0644 $(@D)/$(HOST_GETTEXT_SUBDIR)/ABOUT-NLS \ $(HOST_DIR)/usr/share/gettext/ABOUT-NLS endef HOST_GETTEXT_POST_INSTALL_HOOKS += HOST_GETTEXT_ADD_ABOUT_NLS GETTEXTIZE = $(HOST_CONFIGURE_OPTS) AUTOM4TE=$(HOST_DIR)/usr/bin/autom4te $(HOST_DIR)/usr/bin/gettextize -f $(eval $(autotools-package)) $(eval $(host-autotools-package))
shibajee/buildroot
package/gettext/gettext.mk
mk
mit
3,062
config BR2_PACKAGE_GFLAGS bool "gflags" depends on BR2_INSTALL_LIBSTDCPP help The gflags package contains a C++ library that implements commandline flags processing. It includes built-in support for standard types such as string and the ability to define flags in the source file in which they are used. https://github.com/gflags/gflags comment "gflags needs a toolchain w/ C++" depends on !BR2_INSTALL_LIBSTDCPP
shibajee/buildroot
package/gflags/Config.in
in
mit
434
# Locally computed sha256 d8331bd0f7367c8afd5fcb5f5e85e96868a00fd24b7276fa5fcee1e5575c2662 gflags-v2.1.2.tar.gz
shibajee/buildroot
package/gflags/gflags.hash
hash
mit
112
################################################################################ # # gflags # ################################################################################ GFLAGS_VERSION = v2.1.2 GFLAGS_SITE = $(call github,gflags,gflags,$(GFLAGS_VERSION)) GFLAGS_INSTALL_STAGING = YES GFLAGS_LICENSE = BSD-3c GFLAGS_LICENSE_FILES = COPYING.txt ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),) GFLAGS_CONF_OPTS = -DBUILD_gflags_LIB=OFF -DCMAKE_CXX_FLAGS=-DNO_THREADS endif $(eval $(cmake-package))
shibajee/buildroot
package/gflags/gflags.mk
mk
mit
492
config BR2_PACKAGE_GHOSTSCRIPT_FONTS bool "ghostscript-fonts" help Fonts and font metrics customarily distributed with Ghostscript. Currently includes the 35 standard PostScript fonts and a grab-bag of others. http://sourceforge.net/projects/gs-fonts
shibajee/buildroot
package/ghostscript-fonts/Config.in
in
mit
266
# From http://sourceforge.net/projects/gs-fonts/files/gs-fonts/8.11%20%28base%2035%2C%20GPL%29/ sha1 2a7198e8178b2e7dba87cb5794da515200b568f5 ghostscript-fonts-std-8.11.tar.gz
shibajee/buildroot
package/ghostscript-fonts/ghostscript-fonts.hash
hash
mit
176
################################################################################ # # ghostscript-fonts # ################################################################################ GHOSTSCRIPT_FONTS_VERSION = 8.11 GHOSTSCRIPT_FONTS_SITE = http://downloads.sourceforge.net/project/gs-fonts/gs-fonts/8.11%20%28base%2035%2C%20GPL%29 GHOSTSCRIPT_FONTS_SOURCE = ghostscript-fonts-std-$(GHOSTSCRIPT_FONTS_VERSION).tar.gz GHOSTSCRIPT_FONTS_LICENSE = GPLv2 GHOSTSCRIPT_FONTS_LICENSE_FILES = COPYING GHOSTSCRIPT_FONTS_TARGET_DIR = $(TARGET_DIR)/usr/share/fonts/gs define GHOSTSCRIPT_FONTS_INSTALL_TARGET_CMDS mkdir -p $(GHOSTSCRIPT_FONTS_TARGET_DIR) $(INSTALL) -m 644 $(@D)/*.afm $(GHOSTSCRIPT_FONTS_TARGET_DIR) $(INSTALL) -m 644 $(@D)/*.pfb $(GHOSTSCRIPT_FONTS_TARGET_DIR) endef $(eval $(generic-package))
shibajee/buildroot
package/ghostscript-fonts/ghostscript-fonts.mk
mk
mit
810
configure.ac + Makefile.am: fix the imlib2 detection Although imlib2 is correctly checked for, the variables used to get the CFLAGS and LIBS are wrong (perhaps a remnant of the pre-imlib2 era, when giblib was using imlib). Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> diff --git a/configure.ac b/configure.ac index 6807d86..c8874f0 100644 --- a/configure.ac +++ b/configure.ac @@ -18,16 +18,10 @@ AM_MAINTAINER_MODE AM_WITH_DMALLOC AC_PATH_GENERIC(imlib2, 1.0.0, [ - AC_SUBST(IMLIB_LIBS) - AC_SUBST(IMLIB_CFLAGS) ], + AC_SUBST(IMLIB2_LIBS) + AC_SUBST(IMLIB2_CFLAGS) ], AC_MSG_ERROR(Cannot find imlib2: Is imlib2-config in the path?) ) -dnl the above doesn't work for some reason :/ -IMLIB_LIBS=`imlib2-config --libs` -IMLIB_CFLAGS=`imlib2-config --cflags` -AC_SUBST(IMLIB_LIBS) -AC_SUBST(IMLIB_CFLAGS) - LIBS="$LIBS -lm" CFLAGS="$CFLAGS -Wall" @@ -48,7 +42,7 @@ $PACKAGE $VERSION Configuration: -------------- -Imlib2 libs: $IMLIB_LIBS -Imlib2 cflags: $IMLIB_CFLAGS +Imlib2 libs: $IMLIB2_LIBS +Imlib2 cflags: $IMLIB2_CFLAGS CFLAGS: $CFLAGS " diff --git a/configure.in b/configure.in index 432cb16..6999095 100644 --- a/configure.in +++ b/configure.in @@ -17,16 +17,10 @@ AM_MAINTAINER_MODE AM_WITH_DMALLOC AC_PATH_GENERIC(imlib2, 1.0.0, [ - AC_SUBST(IMLIB_LIBS) - AC_SUBST(IMLIB_CFLAGS) ], + AC_SUBST(IMLIB2_LIBS) + AC_SUBST(IMLIB2_CFLAGS) ], AC_MSG_ERROR(Cannot find imlib2: Is imlib2-config in the path?) ) -dnl the above doesn't work for some reason :/ -IMLIB_LIBS=`imlib2-config --libs` -IMLIB_CFLAGS=`imlib2-config --cflags` -AC_SUBST(IMLIB_LIBS) -AC_SUBST(IMLIB_CFLAGS) - LIBS="$LIBS -lm" CFLAGS="$CFLAGS -Wall" @@ -45,7 +39,7 @@ $PACKAGE $VERSION Configuration: -------------- -Imlib2 libs: $IMLIB_LIBS -Imlib2 cflags: $IMLIB_CFLAGS +Imlib2 libs: $IMLIB2_LIBS +Imlib2 cflags: $IMLIB2_CFLAGS CFLAGS: $CFLAGS " diff --git a/giblib-config.in b/giblib-config.in index f3a7db6..cef1620 100644 --- a/giblib-config.in +++ b/giblib-config.in @@ -42,11 +42,11 @@ while test $# -gt 0; do if test @includedir@ != /usr/include ; then includes=-I@includedir@ fi - echo $includes -I$prefix/include/giblib @IMLIB_CFLAGS@ + echo $includes -I$prefix/include/giblib @IMLIB2_CFLAGS@ ;; --libs) libdirs=-L@libdir@ - echo $libdirs -lgiblib @LDFLAGS@ @IMLIB_LIBS@ + echo $libdirs -lgiblib @LDFLAGS@ @IMLIB2_LIBS@ ;; *) echo "${usage}" 1>&2 diff --git a/giblib.pc.in b/giblib.pc.in index df520ae..783e6e1 100644 --- a/giblib.pc.in +++ b/giblib.pc.in @@ -6,6 +6,6 @@ includedir=@includedir@ Name: giblib Description: wrapper library for imlib2, and other stuff Version: @VERSION@ -Libs: -L${libdir} -lgiblib @LDFLAGS@ @IMLIB_LIBS@ -Cflags: -I${includedir} -I${includedir}/giblib @IMLIB_CFLAGS@ +Libs: -L${libdir} -lgiblib @LDFLAGS@ @IMLIB2_LIBS@ +Cflags: -I${includedir} -I${includedir}/giblib @IMLIB2_CFLAGS@ diff --git a/giblib/Makefile.am b/giblib/Makefile.am index d1edc09..49d8ac4 100644 --- a/giblib/Makefile.am +++ b/giblib/Makefile.am @@ -3,7 +3,7 @@ MAINTAINERCLEANFILES = Makefile.in INCLUDES = \ -I. -I$(top_srcdir) \ --DPREFIX=\""$(prefix)"\" @IMLIB_CFLAGS@ +-DPREFIX=\""$(prefix)"\" @IMLIB2_CFLAGS@ lib_LTLIBRARIES = libgiblib.la @@ -24,7 +24,7 @@ libgiblib_la_SOURCES = \ gib_utils.c gib_utils.h \ gib_queue.c gib_queue.h -libgiblib_la_LIBADD = @IMLIB_LIBS@ +libgiblib_la_LIBADD = @IMLIB2_LIBS@ libgiblib_la_DEPENDENCIES = giblib_config.h libgiblib_la_LDFLAGS = -version-info 1:6:0
shibajee/buildroot
package/giblib/0001-fix-imlib2-detection.patch
patch
mit
3,556
config BR2_PACKAGE_GIBLIB bool "giblib" depends on BR2_PACKAGE_XORG7 depends on !BR2_STATIC_LIBS select BR2_PACKAGE_IMLIB2 select BR2_PACKAGE_IMLIB2_X help Giblib is a simple library which wraps imlib2. http://linuxbrit.co.uk/giblib/ comment "giblib support needs a toolchain w/ dynamic library" depends on BR2_STATIC_LIBS
shibajee/buildroot
package/giblib/Config.in
in
mit
338
# Locally calculated sha256 176611c4d88d742ea4013991ad54c2f9d2feefbc97a28434c0f48922ebaa8bac giblib-1.2.4.tar.gz
shibajee/buildroot
package/giblib/giblib.hash
hash
mit
114
################################################################################ # # giblib # ################################################################################ GIBLIB_VERSION = 1.2.4 GIBLIB_SITE = http://linuxbrit.co.uk/downloads GIBLIB_INSTALL_STAGING = YES GIBLIB_DEPENDENCIES = imlib2 GIBLIB_AUTORECONF = YES GIBLIB_CONF_OPTS = \ --with-imlib2-prefix=$(STAGING_DIR)/usr \ --with-imlib2-exec-prefix=$(STAGING_DIR)/usr GIBLIB_CONFIG_SCRIPTS = giblib-config GIBLIB_LICENSE = MIT GIBLIB_LICENSE_FILES = COPYING $(eval $(autotools-package))
shibajee/buildroot
package/giblib/giblib.mk
mk
mit
558
config BR2_PACKAGE_GIFLIB bool "giflib" help giflib is a library for reading and writing gif images. http://sourceforge.net/projects/giflib
shibajee/buildroot
package/giflib/Config.in
in
mit
149