Ticket #421 (closed bug: fixed)

Opened 13 years ago

Last modified 13 years ago

Fails to compile on netbsd-macppc 4.0.1 (asmfun.s: Error: unsupported relocation against...)

Reported by: wiml Owned by:
Priority: normal Milestone:
Component: none Version: trunk
Severity: medium Keywords: ppc
Cc: Language:
Patch status: Platform: netbsd

Description

A fresh checkout of parrot (r37222) fails to compile on my netbsd-4.0.1-macppc system. The failure message is:

src/asmfun.s: Assembler messages:
src/asmfun.s:6: Error: unsupported relocation against f14
[ repeated several times with different register names and increasing line numbers ]
src/asmfun.s:23: Error: unsupported relocation against r1
gmake: *** [src/asmfun.o] Error 1

I'll attach a more complete copy of the Configure and compiler output as a file. Let me know if there's any important information I'm omitting; I'm a complete stranger to Parrot development.

Attachments

parrot-build-fail.log.gz Download (10.1 KB) - added by wiml 13 years ago.
output of configure and build
parrot-netbsd-ppc.diff Download (1.5 KB) - added by wiml 13 years ago.
Tweaks that allow parrot to build on netbsd-macppc

Change History

Changed 13 years ago by wiml

output of configure and build

  Changed 13 years ago by wiml

Adding -mregnames allows the compile to proceed past asmfun.s, so I guess this is an issue of assembler mnemonics? Maybe using the % register name prefix in asmfun.s would work more portably.

  Changed 13 years ago by jkeenan

A data point: I grepped the attachment and noted that the make output is loaded with the warning cast increases required alignment of target type:

$ grep 'cast increases required alignment of target type' parrot-build-fail.log | \
  cut -d ':' -f 1 | sort | uniq -c
   1 src/embed.c
   1 src/events.c
   2 src/gc/api.c
   2 src/gc/mark_sweep.c
   2 src/gc/pools.c
   2 src/gc/register.c
   1 src/hash.c
 346 src/ops/bit.ops
 486 src/ops/cmp.ops
 205 src/ops/core.ops
   2 src/ops/debug.ops
 116 src/ops/experimental.ops
 159 src/ops/io.ops
 580 src/ops/math.ops
 260 src/ops/object.ops
   6 src/ops/pic.ops
 283 src/ops/pmc.ops
 297 src/ops/set.ops
 508 src/ops/string.ops
  41 src/ops/sys.ops
 120 src/ops/var.ops
   1 src/packfile/pf_items.c
  23 src/pic.c
   1 src/pic_jit.c

Now, a question: How far past asmfun.s did compilation proceed when you added -mregnames? Did make complete? If so, could you submit a Smolder report?

(I don't think we've had many people try to build Parrot on NetBSD on PPC, so we're venturing into unknown territory here.)

Thanks for your reports.
kid51

follow-up: ↓ 5   Changed 13 years ago by wiml

It continues for several more files, but eventually dies compiling src/exec_save.c, with undefined symbols R_PPC_ADDR16_HI and R_PPC_ADDR16_LO. I haven't had time to investigate those more fully, but it looks like NetBSD's elf.h calls those relocs R_PPC_16_HI etc.

The alignment warnings are worrisome, but IIRC they shouldn't cause incorrect behavior, just a performance hit (unaligned access gets emulated via a kernel trap— or maybe I'm thinking of some other architecture, it's been a while). Once Parrot works well enough on this machine to run a few unit tests, I figure I'll look into the alignment warnings. :)

follow-up: ↓ 6   Changed 13 years ago by wiml

An update— with that and a couple other small tweaks, r37259 passes "make test" on netbsd-macppc. So that's pretty cool. I'll see about submitting a Smolder report.

in reply to: ↑ 3   Changed 13 years ago by doughera

Replying to wiml:

The alignment warnings are worrisome, but IIRC they shouldn't cause incorrect behavior, just a performance hit (unaligned access gets emulated via a kernel trap— or maybe I'm thinking of some other architecture, it's been a while).

On SPARC, gcc throws many more such warnings -- 6,948, last time I counted. Over the years, that number has gone down from time to time, but it always seems to creep back up.

Most of them are probably harmless. In particular, most of the ones in the .ops files are probably harmless -- the logic of the surrounding code ensures that the pointers are correctly aligned. Ones outside of the ops files need to be examined individually. I've had mixed success over the years attacking them. Sometimes fixing the alignment warning fixes a bug. Sometimes it leads to greater code clarity. Sometimes it just makes things more convoluted. Alas there is no general rule.

in reply to: ↑ 4   Changed 13 years ago by jkeenan

Replying to wiml:

An update— with that and a couple other small tweaks, r37259 passes "make test" on netbsd-macppc. So that's pretty cool. I'll see about submitting a Smolder report.

Am I correct in thinking that this is  your Smolder report (18819)?

If so, could you post the modifications you made in src/exec_save.c that enabled you to build and test successfully?

Thank you very much.
kid51

Changed 13 years ago by wiml

Tweaks that allow parrot to build on netbsd-macppc

  Changed 13 years ago by wiml

Diff attached. I think they're pretty much independent issues, so maybe they should get their own trac entries.

  Changed 13 years ago by heidnes

A hopefully more acceptable set of patches should be possible to set up by following what's posted in https://trac.parrot.org/parrot/ticket/512 and https://trac.parrot.org/parrot/ticket/454.

  Changed 13 years ago by Infinoid

  • status changed from new to closed
  • resolution set to fixed

Thanks, this should be fixed in r38186. Please reopen this ticket if the issue persists.

Note: See TracTickets for help on using tickets.