Bug #1345

[PATCH]

Added by alexh over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:
Priority:LowDue date:
Assignee:alexh% Done:

0%

Category:-
Target version:-

Description

The following patch adds a bias to all ASSYM symbols that later is ignored by
genassym, as genassym only takes the last 4 digits.
This fixes two major compilation issues with llvm/clang, regarding:
1) lib/libc
2) make depend on sys

http://gitweb.dragonflybsd.org/~alexh/dragonfly.git/commit/5ebe390060e08aff3977372d0e49a1217ea20971

History

#1 Updated by corecode over 5 years ago

This is a seriously nasty hack. The very least it needs to be integrated with
genassym.sh

#2 Updated by alexh over 5 years ago

As can be seen below, it is already integrated into genassym.sh by means of
"substr($1, length($1) - 3, 4)", which only takes the last 4 digits of that
substring.

=========================================================
Excerpt from *CURRENT* sys/kern/genassym.sh
=========================================================
/ C .*sign$/ {
sign = substr($1, length($1) - 3, 4)
sub("^0*", "", sign)
if (sign != "")
sign = "-"
}
/ C .*w0$/ {
w0 = substr($1, length($1) - 3, 4)
}
/ C .*w1$/ {
w1 = substr($1, length($1) - 3, 4)
}
/ C .*w2$/ {
w2 = substr($1, length($1) - 3, 4)
}
/ C .*w3$/ {
w3 = substr($1, length($1) - 3, 4)
=========================================================

#4 Updated by dillon over 5 years ago

:New submission from Alex Hornung <>:
:
:The following patch adds a bias to all ASSYM symbols that later is ignored =
:by
:genassym, as genassym only takes the last 4 digits.
:This fixes two major compilation issues with llvm/clang, regarding:
:1) lib/libc
:2) make depend on sys
:
:http://gitweb.dragonflybsd.org/~alexh/dragonfly.git/commit/5ebe390060e08aff=
:3977372d0e49a1217ea20971

I'm awfully confused. Is something using those array definitions in C?

-Matt
Matthew Dillon
<>

#5 Updated by dillon over 5 years ago

:
:Alex Hornung <> added the comment:
:
:As can be seen below, it is already integrated into genassym.sh by means of
:"substr($1, length($1) - 3, 4)", which only takes the last 4 digits of that
:substring.

I think what needs to be done here is to get rid of the hack entirely
and change genassym.sh over to the type of genassym.c generator we
use for the kernel.

-Matt

#6 Updated by dillon over 5 years ago

Ok, after Alex and I did a lot of messing around we came to the
conclusion that the offset hack is the way to go, at least for now.

The basic problem is that we can't generate proper structure sizes
using the NX mechanism when in a cross-build environment. The only
way to do it is to use the cross-built compiler to generate an
object module and then extract the offsets using nm or objdump.

So for now we will go with the offset hack and retain the nm/awk
stuff.

-Matt

Also available in: Atom PDF