Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Dec 2014 13:28:33 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Larry Rosenman <ler@lerctr.org>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: lsof on FreeBSD/arm
Message-ID:  <1419366513.1018.141.camel@freebsd.org>
In-Reply-To: <c9bcab9ff5aa4a67ec290908e72a53c9@thebighonker.lerctr.org>
References:  <dfbaf5451abce25b512efe4f8c80ff58@thebighonker.lerctr.org> <1419362189.1018.138.camel@freebsd.org> <c9bcab9ff5aa4a67ec290908e72a53c9@thebighonker.lerctr.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Tue, 2014-12-23 at 14:02 -0600, Larry Rosenman wrote:
> On 2014-12-23 13:16, Ian Lepore wrote:
> > On Tue, 2014-12-23 at 11:29 -0600, Larry Rosenman wrote:
> >> Greetings,
> >>      I'm the maintainer of the sysutils/lsof port for FreeBSD.  It's 
> >> been
> >> reported to me that the port doesn't compile on arm.  In investigating
> >> that, I found that some of the includes that lsof includes need a cpu
> >> type defined in order to compile (machine/cpuconf.h).
> >> 
> >> Is there a reason that there is no "default" cpu defined either by the
> >> compiler or environment?
> >> 
> >> Playing in a armv6 poudriere jail, I found I can get it to compile 
> >> via:
> >> borg.lerctr.org /usr/local/etc/poudriere.d $ cat p110armv6-make.conf
> >> CFLAGS += -DCPU_ARM1136=1
> >> borg.lerctr.org /usr/local/etc/poudriere.d $
> >> 
> >> However, I'm not sure if that's kosher for a port to just define.
> >> 
> >> Can any of the arm experts help here?
> >> 
> >> 
> >> 
> > 
> > See if the attached patch helps.  The specific type of cpu shouldn't
> > really matter outside the kernel (or even inside it except in a couple
> > places), what usually matters is the architecture, which we've
> > simplified to v4 versus v6 for most purposes.
> > 
> > The attached patch will use the compiler's predefined values for arch 
> > to
> > set our old-school symbols, which we really need to do a big cleanup
> > pass on, but hopefully this little hack will get you going until that
> > gets done.  Let me know if this works and I'll commit it.
> > 
> > -- Ian
> Thanks.  I'm having a hard time convincing poudriere to apply this patch 
> to the environment
> 
> Any ideas?

Heh, well, it would help if I had tested the patch first... I'm having a
scatterbrain day today.  Try this one.  In fact, I'll just attach the
cpuconf.h itself too so that you can just copy it into the emulator
filesystem for a quick test.

-- Ian


[-- Attachment #2 --]
Index: sys/arm/include/cpuconf.h
===================================================================
--- sys/arm/include/cpuconf.h	(revision 274850)
+++ sys/arm/include/cpuconf.h	(working copy)
@@ -99,6 +99,25 @@
 #endif
 
 #define	ARM_NARCH	(ARM_ARCH_4 + ARM_ARCH_5 + ARM_ARCH_6 | ARM_ARCH_7A)
+
+/*
+ *Compatibility for userland builds that have no CPUTYPE defined.  Use the
+ *symbols predefined by the compiler to get into the right arch ballpark.
+ */
+#if ARM_NARCH == 0
+#if defined(__ARM_ARCH_4T__)
+#undef  ARM_ARCH_4
+#undef  ARM_NARCH
+#define ARM_ARCH_4 1
+#define ARM_NARCH  1
+#elif defined(__ARM_ARCH_6ZK__)
+#undef  ARM_ARCH_6
+#undef  ARM_NARCH
+#define ARM_ARCH_6 1
+#define ARM_NARCH  1
+#endif
+#endif
+
 #if ARM_NARCH == 0 && !defined(KLD_MODULE) && defined(_KERNEL)
 #error ARM_NARCH is 0
 #endif
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1419366513.1018.141.camel>