Quantcast

Cross-buildworld works but not native build?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Cross-buildworld works but not native build?

Tim Kientzle
I've been working with the projects/armv6 tree and have encountered a very confusing situation.

On i386, this works:
  $ make TARGET_ARCH=arm TARGET_CPUTYPE=armv6 buildworld

If I take the resulting world and run it on arm, then the following fails (with the exact same source):
  $ make buildworld
  ….
cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/../../contrib/compiler-rt/lib/umoddi3.c -o umoddi3.o
cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/../../contrib/compiler-rt/lib/umodti3.c -o umodti3.o
cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c -o __sync_fetch_and_add_4.o
In file included from /usr/src/lib/libcompiler_rt/__sync_fetch_and_op_n.h:31,
                 from /usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c:6:
/usr/obj/usr/src/tmp/usr/include/machine/atomic.h: In function 'atomic_cmpset_32':
/usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: 'ARM_RAS_START' undeclared (first use in this function)
/usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: (Each undeclared identifier is reported only once
/usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: for each function it appears in.)
/usr/obj/usr/src/tmp/usr/include/machine/atomic.h: In function 'atomic_add_32':
/usr/obj/usr/src/tmp/usr/include/machine/atomic.h:516: error: 'ARM_RAS_START' undeclared (first use in this function)


Looking at the source, ARM_RAS_START really does seem to be undeclared (it's declared in sysarch.h, but atomic.h only includes sysarch.h for kernel builds).

So it looks to me like the cross-buildworld should fail also.  In any case, it's not clear why the two aren't behaving the same way.

Tim

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Cross-buildworld works but not native build?

Oleksandr Tymoshenko-4

On 2012-04-26, at 11:48 PM, Tim Kientzle <[hidden email]> wrote:

> I've been working with the projects/armv6 tree and have encountered a very confusing situation.
>
> On i386, this works:
>  $ make TARGET_ARCH=arm TARGET_CPUTYPE=armv6 buildworld
>
> If I take the resulting world and run it on arm, then the following fails (with the exact same source):
>  $ make buildworld
>  ….
> cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/../../contrib/compiler-rt/lib/umoddi3.c -o umoddi3.o
> cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/../../contrib/compiler-rt/lib/umodti3.c -o umodti3.o
> cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c -o __sync_fetch_and_add_4.o
> In file included from /usr/src/lib/libcompiler_rt/__sync_fetch_and_op_n.h:31,
>                 from /usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c:6:
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h: In function 'atomic_cmpset_32':
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: 'ARM_RAS_START' undeclared (first use in this function)
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: (Each undeclared identifier is reported only once
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: for each function it appears in.)
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h: In function 'atomic_add_32':
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:516: error: 'ARM_RAS_START' undeclared (first use in this function)
>
>
> Looking at the source, ARM_RAS_START really does seem to be undeclared (it's declared in sysarch.h, but atomic.h only includes sysarch.h for kernel builds).
>
> So it looks to me like the cross-buildworld should fail also.  In any case, it's not clear why the two aren't behaving the same way.
>

Warner Losh committed support for TARGET_ARCH=armv6 to HEAD. It should fix this issue. I started working on merging latest HEAD to project/armv6 _______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Cross-buildworld works but not native build?

Warner Losh
In reply to this post by Tim Kientzle

On Apr 27, 2012, at 12:48 AM, Tim Kientzle wrote:

> I've been working with the projects/armv6 tree and have encountered a very confusing situation.
>
> On i386, this works:
>  $ make TARGET_ARCH=arm TARGET_CPUTYPE=armv6 buildworld
>
> If I take the resulting world and run it on arm, then the following fails (with the exact same source):
>  $ make buildworld
>  ….
> cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/../../contrib/compiler-rt/lib/umoddi3.c -o umoddi3.o
> cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/../../contrib/compiler-rt/lib/umodti3.c -o umodti3.o
> cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c -o __sync_fetch_and_add_4.o
> In file included from /usr/src/lib/libcompiler_rt/__sync_fetch_and_op_n.h:31,
>                 from /usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c:6:
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h: In function 'atomic_cmpset_32':
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: 'ARM_RAS_START' undeclared (first use in this function)
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: (Each undeclared identifier is reported only once
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: for each function it appears in.)
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h: In function 'atomic_add_32':
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:516: error: 'ARM_RAS_START' undeclared (first use in this function)
>
>
> Looking at the source, ARM_RAS_START really does seem to be undeclared (it's declared in sysarch.h, but atomic.h only includes sysarch.h for kernel builds).
>
> So it looks to me like the cross-buildworld should fail also.  In any case, it's not clear why the two aren't behaving the same way.

Does it work if you force MACHINE_ARCH to be armv6?

Warner_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Cross-buildworld works but not native build?

Warner Losh
In reply to this post by Tim Kientzle
sorry for the double reply...

We don't force uname quite right with the patches I did, so you are trying to build MACHINE_ARCH arm on a armv6 box, which will have issues unless you do it cross.

Warner

On Apr 27, 2012, at 12:48 AM, Tim Kientzle wrote:

> I've been working with the projects/armv6 tree and have encountered a very confusing situation.
>
> On i386, this works:
>  $ make TARGET_ARCH=arm TARGET_CPUTYPE=armv6 buildworld
>
> If I take the resulting world and run it on arm, then the following fails (with the exact same source):
>  $ make buildworld
>  ….
> cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/../../contrib/compiler-rt/lib/umoddi3.c -o umoddi3.o
> cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/../../contrib/compiler-rt/lib/umodti3.c -o umodti3.o
> cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c -o __sync_fetch_and_add_4.o
> In file included from /usr/src/lib/libcompiler_rt/__sync_fetch_and_op_n.h:31,
>                 from /usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c:6:
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h: In function 'atomic_cmpset_32':
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: 'ARM_RAS_START' undeclared (first use in this function)
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: (Each undeclared identifier is reported only once
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: for each function it appears in.)
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h: In function 'atomic_add_32':
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:516: error: 'ARM_RAS_START' undeclared (first use in this function)
>
>
> Looking at the source, ARM_RAS_START really does seem to be undeclared (it's declared in sysarch.h, but atomic.h only includes sysarch.h for kernel builds).
>
> So it looks to me like the cross-buildworld should fail also.  In any case, it's not clear why the two aren't behaving the same way.
>
> Tim
>
> _______________________________________________
> [hidden email] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "[hidden email]"
>
>

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Cross-buildworld works but not native build?

Mark Tinguely-2
In reply to this post by Tim Kientzle
On Fri, Apr 27, 2012 at 1:48 AM, Tim Kientzle <[hidden email]> wrote:

> I've been working with the projects/armv6 tree and have encountered a very confusing situation.
>
> On i386, this works:
>  $ make TARGET_ARCH=arm TARGET_CPUTYPE=armv6 buildworld
>
> If I take the resulting world and run it on arm, then the following fails (with the exact same source):
>  $ make buildworld
>  ….
> cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/../../contrib/compiler-rt/lib/umoddi3.c -o umoddi3.o
> cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/../../contrib/compiler-rt/lib/umodti3.c -o umodti3.o
> cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c -o __sync_fetch_and_add_4.o
> In file included from /usr/src/lib/libcompiler_rt/__sync_fetch_and_op_n.h:31,
>                 from /usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c:6:
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h: In function 'atomic_cmpset_32':
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: 'ARM_RAS_START' undeclared (first use in this function)
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: (Each undeclared identifier is reported only once
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: for each function it appears in.)
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h: In function 'atomic_add_32':
> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:516: error: 'ARM_RAS_START' undeclared (first use in this function)
>
>
> Looking at the source, ARM_RAS_START really does seem to be undeclared (it's declared in sysarch.h, but atomic.h only includes sysarch.h for kernel builds).
>
> So it looks to me like the cross-buildworld should fail also.  In any case, it's not clear why the two aren't behaving the same way.
>
> Tim
>

Looks like ARM_ARCH_6 or ARM_ARCH_7A is not defined.

ARM_RAS_START/ARM_RAS_END has been removed out of the the ARMv6/ARMv7 in favor
of the ldrex/strex operations.

Also the ARM_TP_ADDRESS is not used nor mapped and uses a built-in
processor thread
register.

--Mark.
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Cross-buildworld works but not native build?

Warner Losh

On Apr 27, 2012, at 1:51 PM, Mark Tinguely wrote:

> On Fri, Apr 27, 2012 at 1:48 AM, Tim Kientzle <[hidden email]> wrote:
>> I've been working with the projects/armv6 tree and have encountered a very confusing situation.
>>
>> On i386, this works:
>>  $ make TARGET_ARCH=arm TARGET_CPUTYPE=armv6 buildworld
>>
>> If I take the resulting world and run it on arm, then the following fails (with the exact same source):
>>  $ make buildworld
>>  ….
>> cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/../../contrib/compiler-rt/lib/umoddi3.c -o umoddi3.o
>> cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/../../contrib/compiler-rt/lib/umodti3.c -o umodti3.o
>> cc  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c -o __sync_fetch_and_add_4.o
>> In file included from /usr/src/lib/libcompiler_rt/__sync_fetch_and_op_n.h:31,
>>                 from /usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c:6:
>> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h: In function 'atomic_cmpset_32':
>> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: 'ARM_RAS_START' undeclared (first use in this function)
>> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: (Each undeclared identifier is reported only once
>> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:491: error: for each function it appears in.)
>> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h: In function 'atomic_add_32':
>> /usr/obj/usr/src/tmp/usr/include/machine/atomic.h:516: error: 'ARM_RAS_START' undeclared (first use in this function)
>>
>>
>> Looking at the source, ARM_RAS_START really does seem to be undeclared (it's declared in sysarch.h, but atomic.h only includes sysarch.h for kernel builds).
>>
>> So it looks to me like the cross-buildworld should fail also.  In any case, it's not clear why the two aren't behaving the same way.
>>
>> Tim
>>
>
> Looks like ARM_ARCH_6 or ARM_ARCH_7A is not defined.
>
> ARM_RAS_START/ARM_RAS_END has been removed out of the the ARMv6/ARMv7 in favor
> of the ldrex/strex operations.
>
> Also the ARM_TP_ADDRESS is not used nor mapped and uses a built-in
> processor thread
> register.

I think it would work in the current tree if you added TARGET_CPUTYPE=armv6 to the buildworld.

I'm hoping to fix issues like this in my armv6 patches._______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Cross-buildworld works but not native build?

Tim Kientzle
On Apr 27, 2012, at 1:04 PM, Warner Losh wrote:

>
>> On Fri, Apr 27, 2012 at 1:48 AM, Tim Kientzle <[hidden email]> wrote:
>>> I've been working with the projects/armv6 tree and have encountered a very confusing situation.
>>>
>>> On i386, this works:
>>> $ make TARGET_ARCH=arm TARGET_CPUTYPE=armv6 buildworld
>>>
>>> If I take the resulting world and run it on arm, then the following fails (with the exact same source):
>>> $ make buildworld
>
> I think it would work in the current tree if you added TARGET_CPUTYPE=armv6 to the buildworld.
>
> I'm hoping to fix issues like this in my armv6 patches.

With that change, the current armv6 tree can successfully
complete a native buildworld/installworld on BeagleBone.

Next step:  get buildkernel/installkernel to work.  (I have
most of the pieces I need; just some slogging to fit it together
properly.)

Tim

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Cross-buildworld works but not native build?

Warner Losh

On Apr 29, 2012, at 5:22 PM, Tim Kientzle wrote:

> On Apr 27, 2012, at 1:04 PM, Warner Losh wrote:
>>
>>> On Fri, Apr 27, 2012 at 1:48 AM, Tim Kientzle <[hidden email]> wrote:
>>>> I've been working with the projects/armv6 tree and have encountered a very confusing situation.
>>>>
>>>> On i386, this works:
>>>> $ make TARGET_ARCH=arm TARGET_CPUTYPE=armv6 buildworld
>>>>
>>>> If I take the resulting world and run it on arm, then the following fails (with the exact same source):
>>>> $ make buildworld
>>
>> I think it would work in the current tree if you added TARGET_CPUTYPE=armv6 to the buildworld.
>>
>> I'm hoping to fix issues like this in my armv6 patches.
>
> With that change, the current armv6 tree can successfully
> complete a native buildworld/installworld on BeagleBone.
>
> Next step:  get buildkernel/installkernel to work.  (I have
> most of the pieces I need; just some slogging to fit it together
> properly.)

Cool.  I'll be trying to get that change merged into my MACHINE_ARCH=armv6 patches.

Warner

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Loading...