Ticket #512 (closed bug: fixed)
Porting parrot 1.0.0 to NetBSD/macppc
Reported by: | heidnes | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 1.1 |
Component: | core | Version: | 1.0.0 |
Severity: | medium | Keywords: | |
Cc: | he@… | Language: | |
Patch status: | applied | Platform: | netbsd |
Description
Hi,
I decided to look at how difficult it would be to get the recently released parrot 1.0.0 going on NetBSD/macppc 4.0.
The answer turned out to be "not very". :) Cheers for good portability! (But there's another bug report on the way about a non-portable use of the == operator to the "test" program...)
I had to make a few minor adjustments to the code, due to the following differences between the Linux/ppc and NetBSD/macppc (or generally NetBSD/powerpc) targets:
1) The assembler on NetBSD/macppc insists that powerpc registers
must be named with a % prefix. I have verified that Linux/ppc accepts that syntax as well.
2) There is some strange difference going on with respect to
whether externally visible symbols in assembly should have a leading underscore or not, apparently. This affects the minimal assembly fragment for saving the non-volatile registers. Since the assembly code is apparently passed through the preprocessor, a simple #ifdef cured this problem.
3) A couple of ELF-related PPC preprocessor symbols are named
differently in NetBSD. I'm not entirely sure where the correct place is for that workaround -- feel free to relocate to a more appropriate spot.
I've attached my local changes to deal with these three issues. With these in place, my build completed, and a "make test" succeeded with
All tests successful, 17 tests and 580 subtests skipped. Files=398, Tests=11569, 584 wallclock secs (429.43 cusr + 106.05 csys = 535.48 CPU)
Your already tracked issue for OpenBSD at
http://rt.perl.org/rt3//Public/Bug/Display.html?id=40959
should also be fixed by this particular bugfix.
I'll also note that during the build a number of warnings are emitted, similar to this:
src/ops/core_ops_switch.c src/ops/core.ops: In function 'switch_core': src/ops/core.ops:165: warning: cast increases required alignment of target type src/ops/core.ops:191: warning: cast increases required alignment of target type src/ops/core.ops:204: warning: cast increases required alignment of target type src/ops/core.ops:212: warning: cast increases required alignment of target type src/ops/core.ops:236: warning: cast increases required alignment of target type
(the list goes on, also for several other files...) The first one of these appears to be (from src/ops/core_ops_switch.c:
case 8: /* load_bytecode_s */ { #line 165 "src/ops/core.ops"
Parrot_load_bytecode(interp, (*(STRING **)OP_AS_OFFS(1)));
--- osname= netbsd osvers= 4.0 arch= powerpc-netbsd-thread-multi cc= cc --- Flags:
category=core severity=medium ack=no
--- Summary of my parrot 1.0.0 (r0) configuration:
configdate='Mon Mar 23 17:27:34 2009 GMT' Platform:
osname=netbsd, archname=powerpc-netbsd-thread-multi jitcapable=1, jitarchname=ppc-netbsd, jitosname=NETBSD, jitcpuarch=ppc execcapable=1 perl=perl
Compiler:
cc='cc', ccflags=' -pipe -pthread -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -falign-functions=16 -fvisibility=hidden -funit-at-a-time -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wmissing-braces -Wmissing-field-initializers -Wno-missing-format-attribute -Wmissing-include-dirs -Wpacked -Wparentheses -Wpointer-arith -Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef -Wunknown-pragmas -Wno-unused -Wvariadic-macros -Wwrite-strings -Wbad-function-cast -Wc++-compat -Wdeclaration-after-statement -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnonnull -DHAS_GETTEXT',
Linker and Libraries:
ld='cc', ldflags='-Wl,-R/usr/pkg/lib ', cc_ldflags=, libs='-lm -lcrypt -lpthread -lintl'
Dynamic Linking:
share_ext='.so', ld_share_flags='-Wl,-R/usr/pkg/lib --whole-archive -shared ', load_ext='.so', ld_load_flags='-Wl,-R/usr/pkg/lib --whole-archive -shared '
Types:
iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4, ptrsize=4, ptr_alignment=1 byteorder=4321, nv=double, numvalsize=8, doublesize=8, longdoublesize=8
--- Environment:
HOME =/usr/users/he LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH =/usr/users/he/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/pkg/bin:/usr/pkg/sbin:/usr/games:/usr/local/bin:/usr/local/sbin SHELL =/bin/csh