Commit Graph

5987 Commits

Author SHA1 Message Date
christos
73357d78a2 regen vax! 2016-03-23 21:24:52 +00:00
christos
d418ed3dfa Drop PSW annotation for now; it is not a real register and we need special
rtl for it (causes an assertion failure)
2016-03-23 21:21:36 +00:00
christos
3404205800 need stdbool.h 2016-03-23 21:09:04 +00:00
mrg
13c73075bd update the build status for some ppc and mips. 2016-03-23 18:45:41 +00:00
christos
214b89d952 Revert previous changes until we can test them better. 2016-03-23 15:51:36 +00:00
christos
0db9e20bfb From Jake Hamby
For several years I've been eager to find the time to fix the bugs
in C++ exceptions on VAX to get them working on NetBSD, because
theyâve been broken for many years and it looked like only a few
changes were needed to get them working. Without C++ exceptions,
the NetBSD test suite canât be run. The good news is that I was
able to fix all the bugs in the VAX machine description to make
C++ exceptions work in GCC 4.8.5 (version unimportant). I wrote a
blog post explaining the bugs, with patches:


Here's a short summary, with the diffs in text form at the end of this email.

1) Replace #define FRAME_POINTER_CFA_OFFSET(FNDECL) 0 with #define
ARG_POINTER_CFA_OFFSET(FNDECL) 0 in gcc/config/vax/elf.h and
gcc/config/vax/vax.h. This changes the definition of __builtin_dwarf_cfa()
to return %ap instead of %fp, which correctly points to CFA.
Previously, the stack unwinder was crashing in _Unwind_RaiseException()
trying to follow bad pointers from the initial CFA.

2) Define EH_RETURN_DATA_REGNO(N) to include only R2 and R3 (instead
of R2-R5) and add code to vax_expand_prologue() in gcc/config/vax/vax.c
to add R2-R3 to the procedure entry mask but only if crtl->calls_eh_return
is set. This fixes a crash when the stack unwinder tried to write
values to R2 and R3 in the previous stack frame via
__builtin_eh_return_data_regno (0) and __builtin_eh_return_data_regno (1).

3) Removed definitions of EH_RETURN_STACKADJ_RTX and STARTING_FRAME_OFFSET
from gcc/config/vax/elf.h. It's not necessary to remember the stack
adjustment or to waste four bytes on every stack frame for a value
that's not needed. Also remove the suspicious changes in
gcc/config/vax/vax.md to the definitions of call_pop and call_value
regarding DW_CFA_GNU_args_size and EH unwinding. I reverted to the
previous versions from an older version of GCC, adding a few useful
comments that had been removed.

4) The last bug is the one I understand the least. I'm hoping
someone reading this can implement a correct fix. What I was seeing
after making all the previous changes to fix the other bugs is that
my test program failed to catch any exceptions, but instead returned
normally to the original return path.

Investigation revealed that GCC was correctly generating the
necessary move instruction to copy the second parameter passed to
__builtin_eh_return() into the return address, because
EH_RETURN_HANDLER_RTX had been defined correctly in config/vax/elf.h.
Hereâs what the call looks like in gcc/except.c:

#ifdef EH_RETURN_HANDLER_RTX
      rtx insn = emit_move_insn (EH_RETURN_HANDLER_RTX, crtl->eh.ehr_handler);
#else
      error ("__builtin_eh_return not supported on this target");
#endif

The problem was that the optimizer is deleting the final move
instruction when I compile with -O or higher. The assembly code at
-O0 (no optimization) generated for the __builtin_eh_return() call
at the end of _Unwind_RaiseException() looked like:

	calls $2,_Unwind_DebugHook
	movl -12(%fp),%r1
	movl %r1,16(%fp)
	ret
	.cfi_endproc

But then when I compiled with -O1 or -O2, all I saw was:

	calls $2,_Unwind_DebugHook
	ret
	.cfi_endproc

This was a mystery for me and I donât know enough about how the
final peephole optimizer works to really track down why it thinks
it can remove the move call to store the previous return address.
My workaround was to add a call to RTX_FRAME_RELATED_P (insn) = 1;
after the emit_move_insn() in gcc/except.c, which was used in
vax_expand_prologue() to mark the procedure entry mask.

By making this change, the optimizer no longer removes the call to
write the value to the previous stack pointer, but it adds an extra
line of .cfi exception info, which seems unnecessary since the code
is immediately going to return from the call and any adjustment
made by the DWARF stack unwinder will already have been done. Hereâs
what the optimized code looks like with the patch (%r6 had been
loaded earlier):

	calls $2,_Unwind_DebugHook
	movl %r6,16(%fp)
	.cfi_offset 6, -36
	ret
	.cfi_endproc

With that final change, C++ exception handling now finally works
on NetBSD/vax, and I was able to successfully run the vast majority
of the tests in the ATF testsuite, which had been completely
inaccessible when I started due to both atf-run and atf-report
immediately dumping core due to the bad pointers that I fixed. Now
I have a bunch of new bugs to track down fixes for, but I think
this was the hardest set of problems that needed to be solved to
bring NetBSD on VAX up to the level of the other NetBSD ports.

Here are the diffs I have so far. They should apply to any recent
version of GCC (tested on GCC 4.8.5). With the exception of the
hack to gcc/except.c, the other diffs are ready to submit to NetBSD
as well as to upstream GCC. The fix Iâd like to see for the final
problem I discovered of the emit_move_insn() being deleted by the
optimizer would be another patch to one of the files in the
gcc/config/vax directory to explain to the optimizer that writing
to 16(%fp) is important and not something to be deleted from the
epilogue (perhaps it thinks itâs writing to a local variable in
the frame that's about to be destroyed?).

I didn't see any indication that any other GCC ports required
anything special to tell the optimizer not to delete the move
instruction to EH_RETURN_HANDLER_RTX, so the other suspicion I have
is that there may be a bug specific to VAX's peephole optimizer or
related functions. Any ideas?
2016-03-23 12:52:43 +00:00
christos
5ea3c1df8c Fix vax build, now we fail in:
/usr/src/lib/csu/common/crt0-common.c: In function '___start':
/usr/src/lib/csu/common/crt0-common.c:184:1: internal compiler error: in dwf_regno, at dwarf2cfi.c:988
 }
  ^
2016-03-23 12:45:50 +00:00
roy
3cd1bf9411 Describe -M 2016-03-23 10:14:07 +00:00
roy
52194b1e29 Build with interface matching support. 2016-03-23 09:35:25 +00:00
roy
44c22e3889 Add interface matching support with -M, guarded by CONFIG_MATCH_IFACE
The new wpa_supplicant command line argument -M can be used to describe
matching rules with a wildcard name (e.g., "wlan*").

This is very useful for systems without uev (Linux) or devd (FreeBSD).
2016-03-23 09:31:58 +00:00
mrg
2b233e3130 apply -Wno-error=maybe-uninitialized with GCC 5.3. 2016-03-23 09:00:31 +00:00
roy
e620e95ff3 Only down the interface once we are sure we can work with it. 2016-03-23 08:51:02 +00:00
roy
0d1d60cec2 Interface additions/removals are not guaranteed to be for the driver
listening to kernel events. As such, send the events to
wpa_supplicant_event_global() which can then pick the correct interface
registered with wpa_supplicant to send the event to.
2016-03-23 08:48:43 +00:00
mrg
a204afdc5c use -Wno-error=sign-conversion for now. Roy, when you get to GCC 5
you might have a look at this :-)
2016-03-23 08:39:01 +00:00
mrg
8258e9ec7a update a bunch:
- explain the columns
- update arm status:
  - MKCOMPAT problems with oabi
- coldfire builds as much as GCC 4.8
- sun2, m68k builds
- most mips builds now (mips64 has generic build issues)
- update sparc64 and ppc problems (sshd)
  - there is something very very odd in linking libldap.so.4.3 where
    using the GCC 4.8 compiler to link the GCC 5.3 compiled objects
    works, or using GCC 5.3 compiler to link the 4.8 compiled objects
    fails -- ie, the compiler output seems fine, but the interactions
    between GCC and ld(1) are broken.
- add or1k, riscv*, ia64 and ppc64 columns:
  - or1k and riscv* both fail, they need to have their support
    ported to GCC 5.x (i understand that at least one of them
    has a GCC 5.x tree.)
- expand the list of actually tested to complete "build.sh release"
  to include machines, not just cpus.
2016-03-23 07:34:37 +00:00
mrg
b025ea285a avoid unused variables. 2016-03-23 06:59:59 +00:00
mrg
017e647d1f hackaround a problem on mips64 in soft-fp between libgcc and our libc.
i'm not 100% sure how this should work (matt?), as now we have some
functions coming from libc and some from libgcc, but this at least
builds now.
2016-03-23 05:28:01 +00:00
mrg
7e10c3bf91 workaround a problem in old binutils and GCC 5.3. 2016-03-23 05:24:54 +00:00
mrg
6faa8aa178 slightly rearrange the generation of SRCS. 2016-03-23 00:20:18 +00:00
mrg
b1835b1ee7 mknative-gcc for coldfire and GCC 5.3. 2016-03-22 10:09:01 +00:00
mrg
4696acf403 updates to latest -current:
- sshd problem is libldap.so.4.3, at least on sparc64.  placing with 4.8 one works
- alpha mostly works fine, 7 new failures in atf, plus sshd problem
- update release build info for many *earm*, hppa, i386, amd64, mipsel, sh3*
- *mips* now at least completes mknative-gcc
- sh3eb has a mknative-gcc problem
2016-03-22 08:22:04 +00:00
mrg
f64fc53ba7 mips64 does not get (all?) the non sw-float version. fixes double symbol issues. 2016-03-22 08:18:27 +00:00
mrg
e7262bd9c5 mknative-gcc for m68k and m68000 and GCC 5.3. 2016-03-22 08:15:24 +00:00
mrg
32934a1fbb mknative-gcc for mips64* and GCC 5.3. 2016-03-22 06:54:18 +00:00
mrg
e347292cc6 mknative-gcc for GCC 5.3 and mipseb. 2016-03-22 05:09:49 +00:00
mrg
9d759439d5 XXXGCC5: add symlinks for SH .cc files. 2016-03-22 05:08:38 +00:00
mrg
8ae225e173 mknative-gcc for GCC 5.3 and mipseb. 2016-03-22 05:04:41 +00:00
mrg
cd3c7112ee hand-edit some not-yet-regenerated files that break the libstdc++
includes during mknative.
2016-03-22 04:53:16 +00:00
mrg
a39fa7193a mknative-gcc for GCC 5.3 and mipsel. 2016-03-22 04:50:50 +00:00
dholland
600ce53269 Install ftttdrv.h, which was apparently overlooked at some point
(probably because it contains little of substance...) PR 50902.
2016-03-21 05:23:39 +00:00
mrg
0645af0eac update alpha (mostly working) and hppa (mknative-gcc works) 2016-03-20 21:27:27 +00:00
mrg
e10e41c701 mknative-gcc for HPPA and GCC 5.3. thanks for fixing fenv.c, nick! 2016-03-20 21:14:20 +00:00
mrg
0d31cfc9e9 disable -fdelete-null-pointer-checks by default for now. 2016-03-19 20:54:49 +00:00
mrg
4b0e0968c5 note alpha mostly works (sshd problem as well)
add that sparc64 test results are about 60 additional failures
2016-03-19 20:53:46 +00:00
mrg
fed2b588b4 add missing insn-modes.h files from earlier regen. 2016-03-18 20:40:21 +00:00
christos
e31ac8976d Add more stack-protector elides 2016-03-18 17:52:30 +00:00
christos
ccd8517e35 write references as pointers XXX: 2016-03-18 17:11:04 +00:00
christos
8db25f0638 treat class line struct and union 2016-03-18 17:08:45 +00:00
christos
dd09ff20c8 Add support for c++ classes. 2016-03-18 17:07:23 +00:00
christos
63ffeeee3f spell restrict 2016-03-18 16:37:09 +00:00
christos
3e0f598a15 fix printf format 2016-03-18 16:32:03 +00:00
christos
714b78ffa0 Add references, comments. 2016-03-18 16:24:26 +00:00
christos
096b9466af add references. 2016-03-18 16:12:46 +00:00
christos
4a929da448 Add references. 2016-03-18 15:26:31 +00:00
christos
6f5d40c1b7 tidy up: parse DW_AT_specification like DW_AT_abstract_origin 2016-03-18 14:58:18 +00:00
christos
22c82d5b7b - Add processing for c++ references.
- Make sure we load the DIE that contains the types of array elements so
  we can resolve them later.
- Print t_id (die offsets) in hex.
2016-03-18 14:55:34 +00:00
christos
f15ed7b01a swap first, then write. 2016-03-18 13:23:00 +00:00
mrg
007d524719 update info for:
hppa: libc build failes in fenv.c
	m68*: libc fails with stack protector issues
	mips*: libgcc fails
	sh*: initial stuff works
	sparc*: sshd is broken for both, perhaps kernels are SMP problematic
	vax: tools/gcc failes
2016-03-18 10:14:39 +00:00
mrg
fb33ee4218 find all libgcc sources 2016-03-18 10:08:43 +00:00
mrg
243c03d765 disable our local hack to check alloc alignment on arm, as the define
is no longer compile-time constant and CTASSERT() fails.
2016-03-18 10:07:52 +00:00