Andy Ruhl | 5 Apr 2011 17:21
Picon

Re: pkgsrc build error for g95

On Mon, Apr 4, 2011 at 6:47 AM, Izumi Tsutsui <tsutsui <at> ceres.dti.ne.jp> wrote:
>> Well, just to try to see if it works, I set this in /etc/mk.conf:
>>
>>  # cat /etc/mk.conf
>> CFLAGS+= -march=mips3 -mabi=32
>
> I'm not sure if pkgsrc system handles CFLAGS in mk.conf for packages build,
> but we can edit Makefile after "make configure" in the package dir..

Well, I think I already knew this, but the g95 Makefile already has
the correct CFLAGS in it:

(from /usr/pkgsrc/lang/g95/work/g95-0.92/Makefile)

CFLAGS = -O2 -march=mips3 -mabi=32 -DIN_GCC -Wall -Wmissing-prototypes

But the failure is with this other software inside the g95 source dir:

gcc -DHAVE_CONFIG_H -I.     -D_FILE_OFFSET_BITS=64 -DHAVE_REAL_10=0 -fPIC -g -O2
 -MT mutex.o -MD -MP -MF .deps/mutex.Tpo -c -o mutex.o `test -f 'runtime/mutex.c
' || echo './'`runtime/mutex.c
/var/tmp//ccf6fbaP.s: Assembler messages:
/var/tmp//ccf6fbaP.s:30: Error: opcode not supported on this processor: mips1 (m
ips1) `ll $5,0($4)'
/var/tmp//ccf6fbaP.s:32: Error: opcode not supported on this processor: mips1 (m
ips1) `sc $6,0($4)'
gmake[1]: *** [mutex.o] Error 1
gmake[1]: Leaving directory `/usr/pkgsrc/lang/g95/work/g95-0.92/libf95.a-0.92'
gmake: *** [all] Error 2
*** Error code 2
(Continue reading)

Izumi Tsutsui | 5 Apr 2011 18:22
Picon
Gravatar

Re: pkgsrc build error for g95

> But the failure is with this other software inside the g95 source dir:
 :
> When I do "make configure" for g95, it apparently does not build a
> Makefile for libf95:

Hmm, configure looks called during "make", not make configure.

Anyway, work.i386/g95-0.92/libf95.a-0.92/runtime/mutex.c
seems simple enough. How about the attached change?

---
Izumi Tsutsui

--- work/g95-0.92/libf95.a-0.92/runtime/mutex.c.orig	2008-09-17 03:45:13.000000000 +0000
+++ work/g95-0.92/libf95.a-0.92/runtime/mutex.c
 <at>  <at>  -8,6 +8,11  <at>  <at> 

 #include <stdlib.h>

+#ifdef __NetBSD__	/* XXX: available only 5.0 and later */
+#include <sys/atomic.h>
+#define cas(ptr, old, new)	atomic_cas_uint(ptr, old, new)
+
+#else

 /* x86/x86_64 */

 <at>  <at>  -158,6 +163,7  <at>  <at> 

 #endif
(Continue reading)

Andy Ruhl | 6 Apr 2011 02:15
Picon

Re: pkgsrc build error for g95

On Tue, Apr 5, 2011 at 9:22 AM, Izumi Tsutsui <tsutsui <at> ceres.dti.ne.jp> wrote:
>> But the failure is with this other software inside the g95 source dir:
>  :
>> When I do "make configure" for g95, it apparently does not build a
>> Makefile for libf95:
>
> Hmm, configure looks called during "make", not make configure.
>
> Anyway, work.i386/g95-0.92/libf95.a-0.92/runtime/mutex.c
> seems simple enough. How about the attached change?

When you sent this email, I already had a build in progress where I did this:

export CFLAGS="-march=mips3 -mabi=32"
(actually I think I copied the CFLAGS from the Makefile for g95 which
"make configure" created, but I don't have it right now)

And this worked. I have a g95 package now.

So after this I did make clean clean-depends, then make extract, and
applied your patch. I also removed the above CFLAGS from my
/etc/mk.conf file. Then I did make package and it failed. I have
attached a typescript file. The failure is different this time, this
is the last part:

../../libcpp/charset.c:1434: error: expected '=', ',', ';', 'asm' or '__attribut
e__' before '*' token
gmake[1]: *** [charset.o] Error 1
gmake[1]: Leaving directory `/usr/pkgsrc/lang/g95/work/gcc-4.0.3/g95/libcpp'
gmake: *** [all-libcpp] Error 2
(Continue reading)

Izumi Tsutsui | 6 Apr 2011 13:49
Picon
Gravatar

Re: pkgsrc build error for g95

> So after this I did make clean clean-depends, then make extract, and
> applied your patch. I also removed the above CFLAGS from my
> /etc/mk.conf file. Then I did make package and it failed. I have
> attached a typescript file. The failure is different this time, this
> is the last part:

It looks you might have some leftover CFLAGS settings:
>> checking whether the C compiler (gcc -O2 -march=mips3 -mabi=32 \
>> -DIN_GCC -Wall -Wmissing-prototypes ) works... yes

Clean all files and environments?
---
Izumi Tsutsui

Andy Ruhl | 7 Apr 2011 15:17
Picon

Re: pkgsrc build error for g95

On Wed, Apr 6, 2011 at 4:49 AM, Izumi Tsutsui <tsutsui <at> ceres.dti.ne.jp> wrote:
>> So after this I did make clean clean-depends, then make extract, and
>> applied your patch. I also removed the above CFLAGS from my
>> /etc/mk.conf file. Then I did make package and it failed. I have
>> attached a typescript file. The failure is different this time, this
>> is the last part:
>
> It looks you might have some leftover CFLAGS settings:
>>> checking whether the C compiler (gcc -O2 -march=mips3 -mabi=32 \
>>> -DIN_GCC -Wall -Wmissing-prototypes ) works... yes
>
> Clean all files and environments?

You were correct.

I removed the mips CFLAGS options from /etc/mk.conf, and also logged
out and back in to clear my environment variables. Then I did this:

root <at> taz:/usr/pkgsrc/lang/g95 # make extract && patch < patch && make package

This finished with success:

===> Building binary package for g95-0.92
=> Creating binary package /usr/pkgsrc/packages/All/g95-0.92.tgz

Thanks again Izumi.

Maybe we should submit this patch as a fix to the PR? I could try to
tell the person that maintains the libf95 package as well.

(Continue reading)

Izumi Tsutsui | 7 Apr 2011 15:49
Picon
Gravatar

Re: pkgsrc build error for g95

> Maybe we should submit this patch as a fix to the PR? I could try to
> tell the person that maintains the libf95 package as well.

As noted in the diff, "#ifdef __NetBSD__" check won't work on NetBSD 4.x.

Probably atomic_ops(3) check should be in configure like pulseaudio?

---
Izumi Tsutsui


Gmane