Re: About 32bit binary on amd64

2010-05-24 Thread pluknet
On 24 May 2010 08:49, Kohji Okuno  wrote:
> Hi all,
>
> I want to compile 32bit binary on amd64, but I met with the problem.
> Could you teach me the best solution, please?
>
>
> My environment is FreeBSD 8.1-PRERELEASE #0: Tue May 18 12:01:26 JST 2010.
>
> I compiled and executed test.c as below on amd64.
>
[...]
>
> % gcc -m32 -B/usr/lib32 test.c
> % ./a.out
> mmap: Invalid argument

AFAIK, it still doesn't work on FreeBSD. You need something like 32bit
chroot environment.
There's also about:
http://www.freebsd.org/projects/ideas/#p-freebsd-amd64-gcc-m32

-- 
wbr,
pluknet
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: About 32bit binary on amd64

2010-05-24 Thread Kohji Okuno
Thank you for your comments.

In my usage, it works good by the patch appended to this mail.

> On May 24, 2010, at 2:49 AM, pluknet wrote:
> 
>> On 24 May 2010 08:49, Kohji Okuno  wrote:
>>> Hi all,
>>> 
>>> I want to compile 32bit binary on amd64, but I met with the problem.
>>> Could you teach me the best solution, please?
>>> 
>>> 
>>> My environment is FreeBSD 8.1-PRERELEASE #0: Tue May 18 12:01:26 JST 2010.
>>> 
>>> I compiled and executed test.c as below on amd64.
>>> 
>> [...]
>>> 
>>> % gcc -m32 -B/usr/lib32 test.c
>>> % ./a.out
>>> mmap: Invalid argument
>> 
>> AFAIK, it still doesn't work on FreeBSD. You need something like 32bit
>> chroot environment.
>> There's also about:
>> http://www.freebsd.org/projects/ideas/#p-freebsd-amd64-gcc-m32
> 
> -m32 is busted on FreeBSD; I don't remember the full details but I think it 
> had something to do with the linking stage of things...
> Thanks,
> -Garrett
diff -Nur machine.org/_inttypes.h machine/_inttypes.h
--- machine.org/_inttypes.h	2009-08-03 17:13:06.0 +0900
+++ machine/_inttypes.h	2010-05-24 10:16:12.130753024 +0900
@@ -37,6 +37,9 @@
  * $FreeBSD: src/sys/amd64/include/_inttypes.h,v 1.3.34.1 2009/08/03 08:13:06 kensmith Exp $
  */
 
+#ifdef __i386__
+#include 
+#else
 #ifndef _MACHINE_INTTYPES_H_
 #define _MACHINE_INTTYPES_H_
 
@@ -218,3 +221,4 @@
 #define	SCNxPTR		"lx"	/* uintptr_t */
 
 #endif /* !_MACHINE_INTTYPES_H_ */
+#endif /* __i386__ */
diff -Nur machine.org/_inttypes32.h machine/_inttypes32.h
--- machine.org/_inttypes32.h	1970-01-01 09:00:00.0 +0900
+++ machine/_inttypes32.h	2010-05-24 10:17:17.382704652 +0900
@@ -0,0 +1,220 @@
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Klaus Klein.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *must display the following acknowledgement:
+ *This product includes software developed by the NetBSD
+ *Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *contributors may be used to endorse or promote products derived
+ *from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ *	From: $NetBSD: int_fmtio.h,v 1.2 2001/04/26 16:25:21 kleink Exp $
+ * $FreeBSD: src/sys/i386/include/_inttypes.h,v 1.2.36.1 2009/08/03 08:13:06 kensmith Exp $
+ */
+
+#ifndef _MACHINE_INTTYPES_H_
+#define _MACHINE_INTTYPES_H_
+
+/*
+ * Macros for format specifiers.
+ */
+
+/* fprintf(3) macros for signed integers. */
+
+#define	PRId8		"d"	/* int8_t */
+#define	PRId16		"d"	/* int16_t */
+#define	PRId32		"d"	/* int32_t */
+#define	PRId64		"lld"	/* int64_t */
+#define	PRIdLEAST8	"d"	/* int_least8_t */
+#define	PRIdLEAST16	"d"	/* int_least16_t */
+#define	PRIdLEAST32	"d"	/* int_least32_t */
+#define	PRIdLEAST64	"lld"	/* int_least64_t */
+#define	PRIdFAST8	"d"	/* int_fast8_t */
+#define	PRIdFAST16	"d"	/* int_fast16_t */
+#define	PRIdFAST32	"d"	/* int_fast32_t */
+#define	PRIdFAST64	"lld"	/* int_fast64_t */
+#define	PRIdMAX		"jd"	/* intmax_t */
+#define	PRIdPTR		"d"	/* intptr_t */
+
+#define	PRIi8		"i"	/* int8_t */
+#define	PRIi16		"i"	/* int16_t */
+#define	PRIi32		"i"	/* int32_t */
+#define	PRIi64		"lli"	/* int64_t */
+#define	PRIiLEAST8	"i"	/* int_least8_t  */
+#define	PRIiLEAST16	"i"	/* int_least16_t */
+#define	PRIiLEAST32	"i"	/* int_least32_t */
+#define	PRIiLEAST64	"lli"	/* int_least64_t */
+#define	PRIiFAST8	"i"	/* int_fast8_t */
+#define	PRIiFAST16	"i"	/* int_fast16_t */
+#define	PRIiFAST32	"i"	/* int_fast32_t */
+#define	PRIiFAST64	"lli"	/* int_fast64_t */
+#de

Re: About 32bit binary on amd64

2010-05-24 Thread Kostik Belousov
On Mon, May 24, 2010 at 06:58:56PM +0900, Kohji Okuno wrote:
> Thank you for your comments.
> 
> In my usage, it works good by the patch appended to this mail.
The patch is probably a start in the right direction. But, it would be
much better to install sys/i386/include to e.g. /usr/include/machine32
and use the pristine i386 files instead of copying them.

Are you interested in going further with the approach ?

Thanks.
> 
> > On May 24, 2010, at 2:49 AM, pluknet wrote:
> > 
> >> On 24 May 2010 08:49, Kohji Okuno  wrote:
> >>> Hi all,
> >>> 
> >>> I want to compile 32bit binary on amd64, but I met with the problem.
> >>> Could you teach me the best solution, please?
> >>> 
> >>> 
> >>> My environment is FreeBSD 8.1-PRERELEASE #0: Tue May 18 12:01:26 JST 2010.
> >>> 
> >>> I compiled and executed test.c as below on amd64.
> >>> 
> >> [...]
> >>> 
> >>> % gcc -m32 -B/usr/lib32 test.c
> >>> % ./a.out
> >>> mmap: Invalid argument
> >> 
> >> AFAIK, it still doesn't work on FreeBSD. You need something like 32bit
> >> chroot environment.
> >> There's also about:
> >> http://www.freebsd.org/projects/ideas/#p-freebsd-amd64-gcc-m32
> > 
> > -m32 is busted on FreeBSD; I don't remember the full details but I think it 
> > had something to do with the linking stage of things...
> > Thanks,
> > -Garrett


> ___
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


pgpdqsLdI2A0O.pgp
Description: PGP signature


Re: About 32bit binary on amd64

2010-05-24 Thread Garrett Cooper
On May 24, 2010, at 2:49 AM, pluknet wrote:

> On 24 May 2010 08:49, Kohji Okuno  wrote:
>> Hi all,
>> 
>> I want to compile 32bit binary on amd64, but I met with the problem.
>> Could you teach me the best solution, please?
>> 
>> 
>> My environment is FreeBSD 8.1-PRERELEASE #0: Tue May 18 12:01:26 JST 2010.
>> 
>> I compiled and executed test.c as below on amd64.
>> 
> [...]
>> 
>> % gcc -m32 -B/usr/lib32 test.c
>> % ./a.out
>> mmap: Invalid argument
> 
> AFAIK, it still doesn't work on FreeBSD. You need something like 32bit
> chroot environment.
> There's also about:
> http://www.freebsd.org/projects/ideas/#p-freebsd-amd64-gcc-m32

-m32 is busted on FreeBSD; I don't remember the full details but I think it had 
something to do with the linking stage of things...
Thanks,
-Garrett___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: ffs_copyonwrite panics

2010-05-24 Thread Roman Bogorodskiy
  Jeff Roberson wrote:

> >Tried today's -CURRENT and unfortunately the behaviour is still same.
> 
> Can you give me a full stack trace?  Do you have coredumps enabled?
> I would like to have you look at a few things in a core or send it
> to me with your kernel.

I am not sure how to save coredump as when the system boots after the
crash and starts saving coredump from swap partition to disk the system
crashes again.

Generally, the system is almost unusable and in order to try a new
kernel I cross-compile it on my i386 laptop and copy in using livefs
cdrom.

Do you have an idea how to save a trace?

Thanks,

Roman Bogorodskiy


signature.asc
Description: Digital signature


Re: Call for Test and Review: bwn(4) - another Broadcom Wireless driver

2010-05-24 Thread Weongyo Jeong
On Thu, May 20, 2010 at 05:04:51PM +0200, Gustau P??rez wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> En/na Weongyo Jeong ha escrit:
> > On Fri, May 07, 2010 at 06:08:05PM +0200, Gustavo Perez Querol wrote:
> >>> Hello Gustau, I'm so sorry for belated response that I had no time to
> >>> read and work email and wireless stuffs.
> >>>
> >>> Could you please test this symptom with attached patch?  It looks in
> >>> CURRENT it missed to initialize a ratectl when it associates with AP.
> >>>
> >>   The patch made the machine to panic. I think it happened when launching
> >> the supplicant. In fact, right now it works by putting the RF switch to
> >> OFF. As soon as I change it to ON the machine panics.
> >>
> >>   It get a trap 12, with two reasons : page fault and "bufwrite, buffer is
> >> not busy?"
> >>
> >>   I'm running 9.0/AMD64 from 1 of May (don't know exact svn revision).
> >>
> >>   Do you want me to test anything else ?
> >
> > OK.  The patch is ready to test.  Could you please test it with attached
> > patch?
> >
> > regards,
> > Weongyo Jeong
> >
>I've just updated to FreeBSD 8.1 PRERELEASE and I see the
> unsupported rate problem again. I applied the patch for CURRENT and it
> works. So I guess the patch was not MFC in the 8.1 branch.

It's MFCed today.

>However it still works slow (betwenn 200 and 300 kbytes/s). I tried
> using a rum dongle with the same AP (which is a 8.0-STABLE system with
> an Atheros card) and works great when uploading (2Mb sustained).

Umm.  I have no clue why this is happened currently.  When I found any
hints I'll let you know.  Thank you.

>In my laptop I see now messages like these :
> 
> bwn0: RX decryption attempted (old 0 keyidx 0x1)

You could ignore this messages because bwn(4) doesn't support H/W crypto
and it looks it's harmless.

>If you want me to try anything, let me know.

Regards,
Weongyo Jeong

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


[head tinderbox] failure on i386/pc98

2010-05-24 Thread FreeBSD Tinderbox
TB --- 2010-05-25 02:40:00 - tinderbox 2.6 running on freebsd-current.sentex.ca
TB --- 2010-05-25 02:40:00 - starting HEAD tinderbox run for i386/pc98
TB --- 2010-05-25 02:40:00 - cleaning the object tree
TB --- 2010-05-25 02:40:22 - cvsupping the source tree
TB --- 2010-05-25 02:40:22 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca 
/tinderbox/HEAD/i386/pc98/supfile
TB --- 2010-05-25 02:45:58 - building world
TB --- 2010-05-25 02:45:58 - MAKEOBJDIRPREFIX=/obj
TB --- 2010-05-25 02:45:58 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2010-05-25 02:45:58 - TARGET=pc98
TB --- 2010-05-25 02:45:58 - TARGET_ARCH=i386
TB --- 2010-05-25 02:45:58 - TZ=UTC
TB --- 2010-05-25 02:45:58 - __MAKE_CONF=/dev/null
TB --- 2010-05-25 02:45:58 - cd /src
TB --- 2010-05-25 02:45:58 - /usr/bin/make -B buildworld
>>> World build started on Tue May 25 02:45:58 UTC 2010
>>> Rebuilding the temporary build tree
>>> stage 1.1: legacy release compatibility shims
>>> stage 1.2: bootstrap tools
>>> stage 2.1: cleaning up the object tree
>>> stage 2.2: rebuilding the object tree
>>> stage 2.3: build tools
>>> stage 3: cross tools
>>> stage 4.1: building includes
>>> stage 4.2: building libraries
>>> stage 4.3: make dependencies
>>> stage 4.4: building everything
>>> World build completed on Tue May 25 03:43:41 UTC 2010
TB --- 2010-05-25 03:43:41 - generating LINT kernel config
TB --- 2010-05-25 03:43:41 - cd /src/sys/pc98/conf
TB --- 2010-05-25 03:43:41 - /usr/bin/make -B LINT
TB --- 2010-05-25 03:43:41 - building LINT kernel
TB --- 2010-05-25 03:43:41 - MAKEOBJDIRPREFIX=/obj
TB --- 2010-05-25 03:43:41 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2010-05-25 03:43:41 - TARGET=pc98
TB --- 2010-05-25 03:43:41 - TARGET_ARCH=i386
TB --- 2010-05-25 03:43:41 - TZ=UTC
TB --- 2010-05-25 03:43:41 - __MAKE_CONF=/dev/null
TB --- 2010-05-25 03:43:41 - cd /src
TB --- 2010-05-25 03:43:41 - /usr/bin/make -B buildkernel KERNCONF=LINT
>>> Kernel build for LINT started on Tue May 25 03:43:41 UTC 2010
>>> stage 1: configuring the kernel
>>> stage 2.1: cleaning up the object tree
>>> stage 2.2: rebuilding the object tree
>>> stage 2.3: build tools
>>> stage 3.1: making dependencies
>>> stage 3.2: building everything
>>> Kernel build for LINT completed on Tue May 25 04:05:23 UTC 2010
TB --- 2010-05-25 04:05:23 - building GENERIC kernel
TB --- 2010-05-25 04:05:23 - MAKEOBJDIRPREFIX=/obj
TB --- 2010-05-25 04:05:23 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2010-05-25 04:05:23 - TARGET=pc98
TB --- 2010-05-25 04:05:23 - TARGET_ARCH=i386
TB --- 2010-05-25 04:05:23 - TZ=UTC
TB --- 2010-05-25 04:05:23 - __MAKE_CONF=/dev/null
TB --- 2010-05-25 04:05:23 - cd /src
TB --- 2010-05-25 04:05:23 - /usr/bin/make -B buildkernel KERNCONF=GENERIC
>>> Kernel build for GENERIC started on Tue May 25 04:05:24 UTC 2010
>>> stage 1: configuring the kernel
>>> stage 2.1: cleaning up the object tree
>>> stage 2.2: rebuilding the object tree
>>> stage 2.3: build tools
>>> stage 3.1: making dependencies
>>> stage 3.2: building everything
[...]
:> hack.c
cc -shared -nostdlib hack.c -o hack.So
rm -f hack.c
MAKE=/usr/bin/make sh /src/sys/conf/newvers.sh GENERIC
cc -c -O -pipe  -std=c99 -g -Wall -Wredundant-decls -Wnested-externs 
-Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  
-Wundef -Wno-pointer-sign -fformat-extensions -nostdinc  -I. -I/src/sys 
-I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include 
opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 
--param large-function-growth=1000  -mno-align-long-strings 
-mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 
-ffreestanding -fstack-protector -Werror  vers.c
linking kernel.debug
mca.o(.text+0x1627): In function `mca_init':
/src/sys/i386/i386/mca.c:786: undefined reference to `lapic_enable_cmc'
*** Error code 1

Stop in /obj/pc98/src/sys/GENERIC.
*** Error code 1

Stop in /src.
*** Error code 1

Stop in /src.
TB --- 2010-05-25 04:11:08 - WARNING: /usr/bin/make returned exit code  1 
TB --- 2010-05-25 04:11:08 - ERROR: failed to build GENERIC kernel
TB --- 2010-05-25 04:11:08 - 3968.38 user 831.76 system 5468.48 real


http://tinderbox.freebsd.org/tinderbox-head-HEAD-i386-pc98.full
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"