Re: Building Elfutils with Mingw32

2023-09-16 Thread Ulf Hermann via Elfutils-devel
I haven't considered shipping cygwin with perfparser. Is that actually possible? It looks like it needs some installation procedure I would have to burden the user with. I guess shipping cygwin with perfparser would make me a 3PP [1]. Sounds like fun. [1] https://www.cygwin.com/acronyms/#3PP

Re: Building Elfutils with Mingw32

2023-09-16 Thread Ulf Hermann via Elfutils-devel
Hi, I'll answer some questions here: Given that Windows doesn't even use ELF why would you even want elfutils on such a platform? There is a large number of developers who build software for ELF-based embedded systems on windows and test/debug/profile/deploy it over some network or USB conn

Re: Building Elfutils with Mingw32

2023-09-14 Thread Ulf Hermann via Elfutils-devel
Indeed I have noticed the other patches, but I don't think they are the same as mine. So, now we have a three way merge. I guess some more of the changes could be merged if properly cleaned up and made to benefit other obscure platforms, too. However, there are a few I got a definite "no" for.

Re: Building Elfutils with Mingw32

2023-09-13 Thread Ulf Hermann via Elfutils-devel
Hi, keeping the windows/elfutils fork up to date definitely is a lot of work, which is why I haven't found the time to do it for a while. However, perfparser could in fact also use debuginfod (with some caveats). I guess that some more of my patches could be upstreamed if properly cleaned up

Re: Windows build of libelf (or more)?

2021-05-05 Thread Ulf Hermann via Elfutils-devel
The Qt project had some windows libraries: https://code.qt.io/cgit/qt-creator/elfutils.git/ https://download.qt.io/development_releases/prebuilt/elfutils/ Those are somewhat outdated, unfortunately. Contributions through our code review system at https://codereview.qt-project.org are always we

Re: Symbol versioning (Was: [Bug general/24000] couple of testsuite fails with uclibc library)

2019-02-19 Thread Ulf Hermann
> The problem is that without it every elfutils release would (possibly) > break the ABI between the shared libraries and programs using them. > And we don't have/use a different mechanism to indicate symbols/ABI > changed. How do you prevent things breaking when upgrading the > elfutils libraries?

Re: [Bug general/24000] couple of testsuite fails with uclibc library

2019-02-19 Thread Ulf Hermann
Hi, >>> Don't disable symbol versioning, without it binary compatibility is broken. >> >> As per the following commit disabled symbol versioning for uclibc >> https://sourceware.org/git/?p=elfutils.git;a=commit; >> h=bafacacaf7659a4933604662daba26a480b29a8d >> >> with uclibc,the test suite hangs i

Re: [PATCH] configure: Add new --enable-install-elfh option.

2019-01-30 Thread Ulf Hermann
> Yes, it should indeed. > I used a slightly different solution though. > It relies on the default include flags already including the srcdirs. > Does that work for your use case too? (See revised patch attached.) I'm not an expert in autotools. The reason I also have "else" case in my code is th

Re: [PATCH] configure: Add new --enable-install-elfh option.

2019-01-18 Thread Ulf Hermann
I think you should also adapt tests/Makefile.am to use our own elf.h in this case. See https://codereview.qt-project.org/#/c/187812/25 for my solution to this.

[PATCH] Use separate files for strip outputs

2019-01-18 Thread Ulf Hermann
+0100) ---- Ulf Hermann (1): Use separate files for strip outputs tests/ChangeLog | 6 + tests/run-annobingroup.sh| 20 - tests/run-strip-test-many.sh | 53 +-

Re: [PATCH] Skip run-readelf-compressed.sh test if built without bzip2

2019-01-14 Thread Ulf Hermann
> Added a ChangeLog and pushed to master. > Please don't sent patches with base64 encoding. > That make it really hard to apply them with git am. Thanks, and sorry. As the message in my "Sent" folder is plain text with 7bit encoding, it seems that something in between has re-encoded it (or that

[PATCH] Skip run-readelf-compressed.sh test if built without bzip2

2019-01-09 Thread Ulf Hermann
Obviously, we cannot read the compressed ELF file if no bzip2 support is present. Signed-off-by: Ulf Hermann --- tests/run-readelf-compressed.sh | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/run-readelf-compressed.sh b/tests/run-readelf-compressed.sh index a2a04a2a..861553fe

Re: Handling pgoff in perf elf mmap/mmap2 elf info

2018-10-18 Thread Ulf Hermann
Consider: > 0x7fac5ec0b000 to 0x7fac5ed9a000, len = 0x18f000, offset =0 > r--p/usr/lib/libstdc++.so.6.0.25 > 0x7fac5ec94000 to 0x7fac5ed8a000, len =0xf6000, offset = 0x89000 > ---p/usr/lib/libstdc++.so.6.0.25 0x7fac5ec94000 - 0x89000 = 0x7fac5ec0b000 This i

Re: Handling pgoff in perf elf mmap/mmap2 elf info

2018-10-11 Thread Ulf Hermann
Hi Milian, is there any pattern in how the loader maps the ELF sections into memory? What sections does it actually map and which of those do we need for unwinding? I hope that only one of those MMAPs per ELF is actually meaningful and we can simply add that one's pgoff as an extra member to D

Re: How to associate Elf with Dwfl_Module returned by dwfl_report_module

2018-03-22 Thread Ulf Hermann
Hi Milian, > I am regularly seeing broken backtraces for samples where I have > the gut feeling that missing reported ELFs are to blame. But we report > everything, except for scenarios where the mmap events seemingly overlap. Actually, at least for perfparser that's not quite true. When perfpa

Re: How to associate Elf with Dwfl_Module returned by dwfl_report_module

2018-03-21 Thread Ulf Hermann
> MEH: heaptrack_print | mmap: 56166e9d4000 56166ea39000 | dwfl: 56166e9d4000 > 56166ea38880 > MEH: ld-2.26.so | mmap: 7fd0afc6c000 7fd0afe93000 | dwfl: 7fd0afc6c000 > 7fd0afe920f8 > MEH: libc-2.26.so | mmap: 7fd0ae16a000 7fd0ae521000 | dwfl: 7fd0ae16a000 > 7fd0ae5208f0 > MEH: libstdc++.so.6.0.2

Re: ChangeLog entries (Was: [PATCH v3] Use fallthrough attribute)

2018-02-12 Thread Ulf Hermann
> For people that don't like them, what exactly is it about them that you > don't like? And what would you suggest as replacement? I don't like them because they constantly give me problems when merging and for me at least they only repeat, in a less convenient form, what the commit message alre

Re: [PATCH v2] Add fallthrough attributes

2018-02-09 Thread Ulf Hermann
> [...] > +#ifdef HAVE_FALLTHROUGH > + __attribute__ ((fallthrough)); > +#endif > [...] I would like to see this stanza wrapped in a macro, so that we only have one "#ifdef HAVE_FALLTHROUGH" in the code, not another one in every place we want to fall through. See the "internal_function" mac

Re: [PATCH 2/2 v2] Generalize cu_sec_idx

2017-12-21 Thread Ulf Hermann
yes, but the original code really was not correct. The attached patch fixes it by adding an explicit sec_idx field to the Dwarf_CU struct that is set whenever a struct Dwarf_CU is created, so that we never have to guess. This patch combined with the overflow fix makes all testcases PASS. Looks

Re: [PATCH 1/2 v2] Don't overflow in __libdw_in_section

2017-12-21 Thread Ulf Hermann
It is surprising we didn't see more issues with this code. There is also the fake loc cu that fetches data from a different section. I updated both functions as attached. Looks good to me. Ulf

Re: [PATCH 1/2 v2] Don't overflow in __libdw_in_section

2017-12-14 Thread Ulf Hermann
On 12/14/2017 02:43 PM, Mark Wielaard wrote: > (Meta, I have some trouble applying this with git am, it thinks the > patch is malformed. But I can apply by hand of course.) Oh, sorry for that. It's probably the leading spaces again. I keep messing up my mail setup on windows ... > The transforma

Re: [PATCH 2/2 v2] Generalize cu_sec_idx

2017-12-14 Thread Ulf Hermann
On 12/14/2017 02:51 PM, Mark Wielaard wrote: > This is clever and indeed cu_sec_idx () is not generic enough. > But this is also somewhat inefficient. I am working on DWARF5 support > and there a CU can come from even more different sections (or file). So > I am changing Dwarf_CU to have an explici

[PATCH 2/2 v2] Generalize cu_sec_idx

2017-12-08 Thread Ulf Hermann
Change-Id ...) Signed-off-by: Ulf Hermann --- libdw/ChangeLog | 4 libdw/libdwP.h | 12 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 996cd2e..508bf9c 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,7

[PATCH 1/2 v2] Don't overflow in __libdw_in_section

2017-12-08 Thread Ulf Hermann
This exposes a bug in dwarf_formstring as detected by the dwarf-getmacros test. We cannot unconditionally assume that a string is in either the IDX_debug_info or the IDX_debug_types section as determined by cu_sec_idx. (Signed-off instead of Change-Id ...) Signed-off-by: Ulf Hermann --- libdw

[PATCH 2/2] Generalize cu_sec_idx

2017-12-08 Thread Ulf Hermann
Hermann + + * libdwP.h: Generalize cu_sec_idx to check all sections. + 2017-05-09 Ulf Hermann * libdwP.h: Fix check for the upper border of the range in __libdw_in_section. diff --git a/libdw/libdwP.h b/libdw/libdwP.h index e092d8e..8f3a95c 100644 --- a/libdw/libdwP.h +++ b/libdw

[PATCH 1/2] Don't overflow in __libdw_in_section

2017-12-08 Thread Ulf Hermann
libdw/libdwP.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 4375244..996cd2e 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,7 @@ +2017-05-09 Ulf Hermann + + * libdwP.h: Fix check for the upper border of the

Re: [PATCH] Add replacement endian.h and byteswap.h to libgnu

2017-11-16 Thread Ulf Hermann
>> Some systems don't provide endian.h and byteswap.h. The required >> functions are trivial to define using sys/param.h and gcc builtins, >> though. >> >> Also, include endian.h in dwelf_scn_gnu_compressed_size.c as that uses >> be64toh(). > > This is still an issue with non-glibc, non-BSD compil

Re: Compile elfutils with Clang

2017-09-12 Thread Ulf Hermann
Hi Dmitry, I would love to know how you implemented INLINE_NESTED_FUNC, but nested_func.h seems to be missing from your patch. Can you please double check this? regards, Ulf

Re: [PATCH 1/2] Initialize type_offset of fake_cu

2017-09-06 Thread Ulf Hermann
On 05/09/2017 06:28 PM, Ulf Hermann wrote: > Signed-off-by: Ulf Hermann > --- > libdw/ChangeLog | 4 > libdw/dwarf_getmacros.c | 1 + > 2 files changed, 5 insertions(+) > [...] It seems we missed this one, but it fixes a bug. Can we apply it? PATCH 2/2 is not actually related. Ulf

[PATCH v3] Cast pid_t to long long when printing

2017-08-18 Thread Ulf Hermann
We don't know sizeof(pid_t) as it's not specified in any standard. In order to still print it, we cast to long long, the largest integer type we can easily print. (Rebased, and rephrased message: This is not a windows quirk, but rather a standards problem.) Signed-off-by: Ulf Hermann

[PATCH v2] On non-linux systems, don't use native signal numbers

2017-08-18 Thread Ulf Hermann
We assume core files from linux systems, so we should use the linux version of the signals when reading them. Other OS might have different signal numbers. (v1 was a malformed patch) Signed-off-by: Ulf Hermann --- src/ChangeLog | 4 src/readelf.c | 24 +++- 2 files

[PATCH v3] Check if rpath is supported and throw an error if not

2017-08-18 Thread Ulf Hermann
iewed.) Signed-off-by: Ulf Hermann --- ChangeLog | 5 + configure.ac | 22 ++ libdw/ChangeLog | 4 libdw/Makefile.am | 8 +++- 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b720f2cd..47b37565 100644

[PATCH v3] Detect if symbol versioning is supported

2017-08-18 Thread Ulf Hermann
If not, throw an error unless symbol versioning was explicitly disabled. (Reposting rebased patch, as v2 apparently slipped) Signed-off-by: Ulf Hermann --- ChangeLog| 4 configure.ac | 15 +++ 2 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index

[PATCH] Drop *_so_SOURCES from libasm, libdw, libelf Makefile.am

2017-08-18 Thread Ulf Hermann
They aren't used and cause warnings from autoconf. Signed-off-by: Ulf Hermann --- libasm/ChangeLog | 4 libasm/Makefile.am | 1 - libdw/ChangeLog| 4 libdw/Makefile.am | 1 - libelf/ChangeLog | 4 libelf/Makefile.am | 1 - 6 files changed, 12 insertions(+), 3 dele

[PATCH] Drop -rdynamic from deleted-lib.so link step

2017-08-18 Thread Ulf Hermann
a shared object, will automatically export the (non-hidden) "libfunc" symbol anyway. (This patch supersedes "[PATCH] Check if gcc supports -rdynamic and don't use it if not" from 05/03/2017) Signed-off-by: Ulf Hermann --- tests/ChangeLog | 4 tests/Makefile.am | 2

[PATCH v2] Make sure packed structs follow the gcc memory layout

2017-08-18 Thread Ulf Hermann
h the cracks.) Signed-off-by: Ulf Hermann --- ChangeLog | 5 + backends/ChangeLog | 4 backends/linux-core-note.c | 2 +- configure.ac | 13 + lib/ChangeLog | 5 + lib/eu-config.h| 8 libcpu/Chan

[PATCH v2] Check if gcc complains about __attribute__ (visibility(..))

2017-08-18 Thread Ulf Hermann
hes is low anyway. (I'm reposting this patch, rebased and with extended commit message. v1 was apparently not accepted because the patch's implications were misunderstood.) Signed-off-by: Ulf Hermann --- ChangeLog | 5 + configure.ac| 16 lib/

[PATCH v3] Check for -z,defs, -z,relro, -fPIC, -fPIE before using them

2017-08-18 Thread Ulf Hermann
than shared libraries. (I'm reposting this patch, rebased to not depend on any others, with extended commit message. v2 was apparently not accepted because the patch's implications were misunderstood.) Signed-off-by: Ulf Hermann --- ChangeLog| 5 + backends/Change

Problems in dwfl_segment_report_module

2017-05-10 Thread Ulf Hermann
Hi, In dwfl_segment_report_module.c:657ff we have this heuristic to determine if an elf is invalid: if ((module_end > module->start && module_start < module->end) || dyn_vaddr == module->l_ld) { if (module->elf != NULL && invalid_elf (modul

[PATCH 2/2] Don't overflow in __libdw_in_section

2017-05-09 Thread Ulf Hermann
This exposes a bug in dwarf_formstring as detected by the dwarf-getmacros test. We cannot unconditionally assume that a string is in either the IDX_debug_info or the IDX_debug_types section as determined by cu_sec_idx. Signed-off-by: Ulf Hermann --- libdw/ChangeLog | 4 libdw/libdwP.h | 3

[PATCH 1/2] Initialize type_offset of fake_cu

2017-05-09 Thread Ulf Hermann
Signed-off-by: Ulf Hermann --- libdw/ChangeLog | 4 libdw/dwarf_getmacros.c | 1 + 2 files changed, 5 insertions(+) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index eda35c5..665c232 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,7 @@ +2017-05-09 Ulf Hermann

Re: Problems with dwarf-getmacros test

2017-05-09 Thread Ulf Hermann
Do you have the whole call stack of that failed __libdw_read_offset call? Which source line in tests/dwarf-getmacros.c prints the "(null)"? Actually I just managed to catch a backtrace by inserting an infinite loop at the point where it would normally return -1. It turns out the address we are l

Re: Problems with dwarf-getmacros test

2017-05-09 Thread Ulf Hermann
Do you have the whole call stack of that failed __libdw_read_offset call? Which source line in tests/dwarf-getmacros.c prints the "(null)"? Actually I just managed to catch a backtrace by inserting an infinite loop at the point where it would normally return -1. It turns out the address we are

Re: Problems with dwarf-getmacros test

2017-05-09 Thread Ulf Hermann
> Is it only with testfile-macros? > All other testfiles always run correctly? Yes, it only happens with the testfile-macros check at 0xb. > Do you have the whole call stack of that failed __libdw_read_offset > call? Which source line in tests/dwarf-getmacros.c prints the "(null)"? I'm having a

Problems with dwarf-getmacros test

2017-05-08 Thread Ulf Hermann
Hi, I frequently get failures from the run-dwarf-getmacros.sh test, on testfile-macros:0xb. The test repeatedly outputs "(null)" instead of the actual macros and then runs into the assert at dwarf-getmacros.c:50. The failure is very nondeterministic, though. I haven't found a reliable way to

[PATCH] On non-linux systems, don't use native signal numbers

2017-05-08 Thread Ulf Hermann
We assume core files from linux systems, so we should use the linux version of the signals when reading them. Other OS might have different signal numbers. Signed-off-by: Ulf Hermann --- src/readelf.c | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git

[PATCH v2] Cast pid_t to long long when printing

2017-05-08 Thread Ulf Hermann
On windows x86_64 pid_t is 64bit wide. We need to adapt our printf format respectively. (We can actually print the extra bits in a portable way, so let's do it rather than casting to int and ignoring them.) Signed-off-by: Ulf Hermann --- src/ChangeLog | 4 src/stack.c

Re: windows patches

2017-05-08 Thread Ulf Hermann
Hi Mark, > Thanks a lot for all your work and posting the patches. > I will go through them next week. Thanks for reviewing them. The ones that got accepted will already make my life easier. > I quickly scanned some just now. Some seem fine to go in. But others are > a bit more iffy. I think so

[PATCH v2] Avoid using err() and errx() in tests

2017-05-08 Thread Ulf Hermann
fprintf() and exit() do the same job and are portable. (v1 was missing the errno.h include in allfcts.c) Signed-off-by: Ulf Hermann --- tests/ChangeLog | 6 ++ tests/allfcts.c | 47 --- tests/buildid.c | 6 +++--- tests

windows patches

2017-05-04 Thread Ulf Hermann
Hi, all patches I consider suitable for upstream right now have been posted here now. With all of them applied you still don't get useful elfutils on windows, as for example the date preservation in some of the tools doesn't work. I have more patches that just blatantly drop functionality I don

[PATCH] Use trees rather than hashes in ar.c

2017-05-04 Thread Ulf Hermann
The tree functions are more widely available. Signed-off-by: Ulf Hermann --- src/ChangeLog | 4 src/ar.c | 77 ++- 2 files changed, 48 insertions(+), 33 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 332b07c

[PATCH v2] Close files before renaming or unlinking them

2017-05-04 Thread Ulf Hermann
On windows we cannot rename or unlink open files. (strip.c was missing) Signed-off-by: Ulf Hermann --- libasm/ChangeLog | 4 libasm/asm_end.c | 15 +++ src/ChangeLog| 4 src/strip.c | 5 - tests/ChangeLog | 9 + tests/newfile.c | 7

[PATCH] Define uid_t and gid_t in system-elf-libelf-test.c if necessary

2017-05-04 Thread Ulf Hermann
mode. Therefore we need a workaround here. Signed-off-by: Ulf Hermann --- tests/ChangeLog| 4 tests/system-elf-libelf-test.c | 5 + 2 files changed, 9 insertions(+) diff --git a/tests/ChangeLog b/tests/ChangeLog index 1a77c02..678a882 100644 --- a/tests/ChangeLog +++ b/

[PATCH] Remove previous test files before running the next round

2017-05-04 Thread Ulf Hermann
strip explicitly creates the new files. This will not work on windows if the files already exist. Signed-off-by: Ulf Hermann --- tests/ChangeLog | 5 + tests/run-strip-reloc.sh | 2 ++ 2 files changed, 7 insertions(+) diff --git a/tests/ChangeLog b/tests/ChangeLog index f43aeba

[PATCH] Correctly determine STACKCMD on windows

2017-05-04 Thread Ulf Hermann
error() will only output the file name, but with ".exe" on windows. Signed-off-by: Ulf Hermann --- tests/ChangeLog | 6 ++ tests/run-stack-d-test.sh | 5 + tests/run-stack-demangled-test.sh | 5 + tests/run-stack-i-test.sh | 5 + 4 fil

[PATCH] Use octal numbers rather than permission macros

2017-05-04 Thread Ulf Hermann
The permission macros are not guaranteed to be defined and the octal numbers are rather well known. Signed-off-by: Ulf Hermann --- src/ChangeLog | 7 +++ src/ar.c| 8 src/elfcompress.c | 4 ++-- src/ranlib.c| 2 +- src/strip.c | 2 +- tests

[PATCH] Write to /dev/null rather than /dev/zero

2017-05-04 Thread Ulf Hermann
/dev/zero is meant for reading zeroes. /dev/null is for writing into nirvana. Signed-off-by: Ulf Hermann --- tests/ChangeLog | 4 tests/elfshphehdr.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index b8de138..fef6f55 100644

[PATCH] Cast pid_t to int when printing it with %d

2017-05-04 Thread Ulf Hermann
On windows x86_64 pid_t is 64bit wide. We ignore the extra bits as those messages are only informational anyway. Signed-off-by: Ulf Hermann --- src/ChangeLog | 4 src/stack.c | 20 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/ChangeLog b/src

[PATCH] Increase stack usage limit to 512k

2017-05-04 Thread Ulf Hermann
On windows x86_64 we need more stack in some places. Signed-off-by: Ulf Hermann --- config/ChangeLog | 4 config/eu.am | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/ChangeLog b/config/ChangeLog index 0f240ea..642d765 100644 --- a/config/ChangeLog +++ b

[PATCH] Provide build rules for a compatibility library

2017-05-04 Thread Ulf Hermann
angle from the GNU libstdc++ available is very helpful, so we include that, too. Signed-off-by: Ulf Hermann --- ChangeLog| 4 configure.ac | 1 + lib/ChangeLog| 6 ++ lib/Makefile.am | 35 +-- lib/eu_compat.def.in

[PATCH] Provide a windows-specific ORIGINDIR for eblopenbackend

2017-05-04 Thread Ulf Hermann
$ORIGIN and $LIB are not supported by all implementations of dlopen() and on windows we need backslashes as directory separators. Signed-off-by: Ulf Hermann --- libebl/ChangeLog| 5 + libebl/eblopenbackend.c | 4 2 files changed, 9 insertions(+) diff --git a/libebl/ChangeLog b

[PATCH] Drop the trickery in printversion.h

2017-05-04 Thread Ulf Hermann
The mechanism of moving argp_program_version_hook and argp_program_bug_address to .rodata is not portable and two pointers per program are not worth the effort to make it portable. Revert the pointers to be non-const. Signed-off-by: Ulf Hermann --- lib/ChangeLog | 5 + lib

[PATCH] Close files before renaming or unlinking them

2017-05-04 Thread Ulf Hermann
On windows we cannot rename or unlink open files. Signed-off-by: Ulf Hermann --- libasm/ChangeLog | 4 libasm/asm_end.c | 15 +++ tests/ChangeLog | 9 + tests/newfile.c | 7 +-- tests/newscn.c | 3 ++- tests/update1.c | 1 + tests/update2.c | 1 + tests

[PATCH] Adapt debug info fstat check for windows

2017-05-04 Thread Ulf Hermann
which that holds by chance. Signed-off-by: Ulf Hermann --- libdwfl/ChangeLog| 5 + libdwfl/find-debuginfo.c | 9 + 2 files changed, 14 insertions(+) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index ee550d0..517ba21 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/Chan

[PATCH] Use OS-specific paths

2017-05-04 Thread Ulf Hermann
In general we need to use ';' as path separator and '\' and directory separator on windows. The shell will automatically translate paths to some extent, but we have to call "pwd -W" rather than plain "pwd" to get something useful. Signed

[PATCH] Have diff ignore line ending differences when testing

2017-05-04 Thread Ulf Hermann
This accounts for the CR/LF problem we get when producing text files on windows. Signed-off-by: Ulf Hermann --- tests/ChangeLog | 7 +++ tests/run-addr2line-test.sh | 8 tests/run-readelf-test1.sh | 2 +- tests/run-unstrip-n.sh | 2 +- tests/test-subr.sh

[PATCH] Open files in O_BINARY

2017-05-04 Thread Ulf Hermann
If O_BINARY is not defined, define it to 0, so that the change has no effect then. Some systems have separate binary and text modes for files, and we don't want the text mode to be used. Change-Id: If7efb5bd448c2a1c7d1eb5dab276849b1b15a3ce Signed-off-by: Ulf Hermann --- lib/Chan

[PATCH] Skip deleted test if fork(2) is unavailable

2017-05-04 Thread Ulf Hermann
Signed-off-by: Ulf Hermann --- ChangeLog | 4 configure.ac| 1 + tests/ChangeLog | 4 tests/deleted.c | 14 ++ 4 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index 662c633..2cf7bd6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9

[PATCH] Avoid using err() and errx() in tests

2017-05-04 Thread Ulf Hermann
fprintf() and exit() do the same job and are portable. Signed-off-by: Ulf Hermann --- tests/ChangeLog | 6 ++ tests/allfcts.c | 46 +++--- tests/buildid.c | 6 +++--- tests/debugaltlink.c | 6 +++--- 4 files changed, 43 insertions

[PATCH v2] Check for existence of GNU-style strerror_r

2017-05-04 Thread Ulf Hermann
We cannot get GNU strerror_r from gnulib. If we don't have it, we don't translate system error codes to strings in dwfl_error.c. (rebased on top of all the other patches) Signed-off-by: Ulf Hermann --- ChangeLog| 4 configure.ac | 2 ++ libdwfl/Change

[PATCH] Skip fchown, fchmod, fadvise, fallocate if functions are unavailable

2017-05-04 Thread Ulf Hermann
available and unreliable. fadvise is an optimization. Signed-off-by: Ulf Hermann --- ChangeLog | 5 + configure.ac| 3 +++ libasm/ChangeLog| 4 libasm/asm_end.c| 2 ++ libelf/ChangeLog| 5 + libelf/elf_update.c | 4 src/ChangeLog

[PATCH] Define roundup() for strings.c if it doesn't exist

2017-05-04 Thread Ulf Hermann
Change-Id: I6ea7c1f894e89bbaaecb724473c4c00e67296f05 Signed-off-by: Ulf Hermann --- src/ChangeLog | 4 src/strings.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 64db1ca..4a32604 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7

[PATCH] Add our own tdestroy if search.h exposes a node_t struct

2017-05-04 Thread Ulf Hermann
to libgnu.a. Signed-off-by: Ulf Hermann --- ChangeLog | 5 + configure.ac | 21 + libgnu/ChangeLog | 5 + libgnu/Makefile.am | 6 +- libgnu/tdestroy.c | 47 +++ 5 files changed, 83 insertions(+), 1

[PATCH] Check for existence of GNU-style basename()

2017-05-04 Thread Ulf Hermann
If it doesn't exist, add an implementation to libgnu.a and config.h. Signed-off-by: Ulf Hermann --- ChangeLog | 4 configure.ac | 16 +++ libgnu/ChangeLog | 6 ++ libgnu/Makefile.am| 6 +- libgnu/basename-gnu.c

[PATCH] Define unlocked io functions to locked ones if they are unavailable

2017-05-04 Thread Ulf Hermann
The locked IO functions will still do the job, albeit a bit slower. Signed-off-by: Ulf Hermann --- ChangeLog | 4 configure.ac| 4 lib/ChangeLog | 5 + lib/eu-config.h | 28 4 files changed, 41 insertions(+) diff --git a/ChangeLog b

[PATCH] Wrap gnulib fts_.h in fts.h

2017-05-04 Thread Ulf Hermann
For some reason gnulib calls the headers fts_.h. We need to wrap it into an actual fts.h to make it available. Signed-off-by: Ulf Hermann --- ChangeLog | 4 configure.ac | 18 +++--- libgnu/ChangeLog | 5 + libgnu/Makefile.am | 9 - libgnu

Re: [PATCH] Avoid double-including config.h

2017-05-04 Thread Ulf Hermann
On 05/02/2017 01:55 PM, Ulf Hermann wrote: >> Maybe we can cleanup that last >> one once we integrate gnulib (which I believe has a good/64-off_t fts.h >> already). > > gnulib is among the bad ones. Or, at least we detect it as bad. Sorry, I meant the msys fts.h. That is

[PATCH] Add a stdio_ext.h that defines __fsetlocking away

2017-05-04 Thread Ulf Hermann
__fsetlocking is a nice optimization, but if it's unavailable, we can do without. Signed-off-by: Ulf Hermann --- ChangeLog | 4 configure.ac | 3 +++ libgnu/ChangeLog | 5 + libgnu/Makefile.am| 9 - libgnu/stdio_ext.in.h

[PATCH] Add empty features.h replacement

2017-05-04 Thread Ulf Hermann
environment. Signed-off-by: Ulf Hermann --- ChangeLog| 4 configure.ac | 3 +++ libgnu/ChangeLog | 5 + libgnu/Makefile.am | 10 +- libgnu/features.in.h | 35 +++ 5 files changed, 56 insertions(+), 1 deletion(-) create

[PATCH v2] Add a "selfcontained" mode to provide missing headers on windows

2017-05-04 Thread Ulf Hermann
features.h declarations are provided like mingw defines them. (v1 had features.h directly in the install rule, which is impractical as we will need to add more things later) Signed-off-by: Ulf Hermann --- ChangeLog | 4 configure.ac | 6 ++ lib/ChangeLog | 6 ++ lib

[PATCH] Add ar.h for systems where it doesn't exist

2017-05-04 Thread Ulf Hermann
Signed-off-by: Ulf Hermann --- ChangeLog | 4 configure.ac | 3 +++ libgnu/ChangeLog | 5 + libgnu/Makefile.am | 9 - libgnu/ar.in.h | 59 ++ 5 files changed, 79 insertions(+), 1 deletion(-) create

[PATCH] Add sysconf replacement for win32

2017-05-04 Thread Ulf Hermann
We cannot get sysconf() from gnulib and the only thing we need it for is getting the page size. Therefore, of the various possible sysconf parameters we only define and implement _SC_PAGESIZE in our replacement. Signed-off-by: Ulf Hermann --- ChangeLog | 6 ++ configure.ac

[PATCH v2] Add mman.h/.c for win32

2017-05-04 Thread Ulf Hermann
We cannot get mmap() and friends from gnulib and they don't exist on windows. The functionality we need can be implemnted using native win32 functions, though. (changelog entries were missing in V1) Signed-off-by: Ulf Hermann --- ChangeLog | 4 ++ configure.ac

[PATCH] Add mman.h/.c for win32

2017-05-04 Thread Ulf Hermann
We cannot get mmap() and friends from gnulib and they don't exist on windows. The functionality we need can be implemnted using native win32 functions, though. Signed-off-by: Ulf Hermann --- configure.ac| 7 +++ libgnu/Makefile.am | 17 +- libgnu/mman_win32.c

[PATCH] Add replacement endian.h and byteswap.h to libgnu

2017-05-03 Thread Ulf Hermann
Some systems don't provide endian.h and byteswap.h. The required functions are trivial to define using sys/param.h and gcc builtins, though. Also, include endian.h in dwelf_scn_gnu_compressed_size.c as that uses be64toh(). Signed-off-by: Ulf Hermann --- Chan

[PATCH] If f(un)lockfile is unavailable define it away

2017-05-03 Thread Ulf Hermann
Sometimes _POSIX_THREAD_SAFE_FUNCTIONS is still set in this case, which in turn leads to build problems in getopt.c (which would define the functions to nop anyway if it knew they aren't present). Signed-off-by: Ulf Hermann --- lib/ChangeLog | 5 + lib/eu-config.h | 7 +++ 2

[PATCH] Add a "selfcontained" mode to provide missing headers on windows

2017-05-03 Thread Ulf Hermann
features.h declarations are provided like mingw defines them. Signed-off-by: Ulf Hermann --- ChangeLog | 4 configure.ac | 6 ++ lib/ChangeLog | 6 ++ lib/Makefile.am| 11 ++- lib/features.h.in | 43 +++ libelf

[PATCH] Drop __BEGIN_DECLS and __END_DECLS from elf.h

2017-05-03 Thread Ulf Hermann
We don't use those anywhere else and they are not guaranteed to be defined. Also, put the 'extern "C"' after the included headers. Signed-off-by: Ulf Hermann --- libelf/ChangeLog | 4 libelf/elf.h | 10 +++--- 2 files changed, 11 insertions(+), 3 deletion

[PATCH v2] Check if rpath is supported before setting it

2017-05-03 Thread Ulf Hermann
Some systems don't have rpath. In that case the backends need to be made available by some external mechanism. Provide a configure switch to explicitly turn off the setting of rpaths. Throw an error if that is not set and rpath is not supported. Signed-off-by: Ulf Hermann --- Chan

[PATCH v2] Detect if symbol versioning is supported (was "Disable symbol versioning if .symver doesn't work")

2017-05-03 Thread Ulf Hermann
If not, throw an error unless symbol versioning was explicitly disabled. Signed-off-by: Ulf Hermann --- ChangeLog| 4 configure.ac | 15 +++ 2 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index 01f88f3..22c46c6 100644 --- a/ChangeLog +++ b/ChangeLog

Re: pending patches

2017-05-03 Thread Ulf Hermann
> - Check for -z,defs, -z,relro, -fPIC, -fPIE before using them > There are actually two versions, I haven't looked yet how they differ. There was a typo in tests/Makefile.am which I fixed in the second version. This change actually doesn't disable symbol versioning or rpath. It just condition

[PATCH] Make sure packed structs follow the gcc memory layout

2017-05-03 Thread Ulf Hermann
On windows gcc by default generates code that follows the MSVC layout. We don't want that as it adds extra padding. Signed-off-by: Ulf Hermann --- ChangeLog | 5 + backends/ChangeLog | 4 backends/linux-core-note.c | 2 +- configure.ac

Re: pending patches

2017-05-03 Thread Ulf Hermann
> - Check for -z,defs, -z,relro, -fPIC, -fPIE before using them > There are actually two versions, I haven't looked yet how they differ. > - Check if gcc complains about __attribute__ (visibility(..)) > - Disable symbol versioning if .symver doesn't work > - Check if rpath is supported before set

[PATCH] Check if gcc supports -rdynamic and don't use it if not

2017-05-03 Thread Ulf Hermann
On some platforms the symbols are automatically exported and -rdynamic will produce a warning. Signed-off-by: Ulf Hermann --- ChangeLog | 4 configure.ac | 11 +++ tests/ChangeLog | 5 + tests/Makefile.am | 2 +- 4 files changed, 21 insertions(+), 1 deletion

[PATCH] Generate .lib files on PE platforms

2017-05-03 Thread Ulf Hermann
le.am | 27 --- 8 files changed, 106 insertions(+), 9 deletions(-) diff --git a/config/ChangeLog b/config/ChangeLog index 0f240ea..34414a3 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2017-05-03 Ulf Hermann + + * eu.am: If we're b

Re: [PATCH] Make elf section sorting more deterministic

2017-05-03 Thread Ulf Hermann
[...] How about the attached? Looks good to me. Ulf

Re: [PATCH] Avoid double-including config.h

2017-05-02 Thread Ulf Hermann
Maybe we can cleanup that last one once we integrate gnulib (which I believe has a good/64-off_t fts.h already). gnulib is among the bad ones. Or, at least we detect it as bad. Ulf

Re: [PATCH] Don't look for kernel version if not running on linux

2017-05-02 Thread Ulf Hermann
You can get uname() on Windows through gnulib, but at the cost at linking to additional windows DLLs. It calls gethostname and for that we need to link against ws2_32.dll. That's an unreasonable dependency for getting something we cannot use anyway. I suggest we just set errno to ENOTSUP then. I

[PATCH] Check native binary format

2017-04-28 Thread Ulf Hermann
If our native binary format is not ELF, there is no point in doing the textrel check and we have to exclude some tests that compile source code with the native compiler and then check something on the resulting binary with elfutils. Signed-off-by: Ulf Hermann --- ChangeLog

[PATCH] Generalize library names

2017-04-28 Thread Ulf Hermann
On windows library names end with ".dll" and the prefix "lib" us usually omitted. Take this into account and also drop the $(EXEEXT) workaround. We don't need to use noinst_PROGRAMS as there is also noinst_DATA. Change-Id: I7e4ba2432811d5ad85051ea0c9d5674eabf79b3c S

  1   2   >