Re: #includes and #defined

2018-08-10 Thread Warner Losh
On Fri, Aug 10, 2018 at 5:30 PM, Erich Dollansky <
freebsd.ed.li...@sumeritec.com> wrote:

> Hi,
>
> On Fri, 10 Aug 2018 07:53:19 -0600
> Warner Losh  wrote:
>
> > On Thu, Aug 9, 2018 at 11:51 PM, Erich Dollansky <
> > freebsd.ed.li...@sumeritec.com> wrote:
> >
> > > On Fri, 10 Aug 2018 12:40:48 +0800
> > > blubee blubeeme  wrote:
> > >
> > > >
> > > > What about the architecture name is it recommended to use x86_64
> > > > or amd64?
> > >
> > > my clang reports on an Intel CPU:
> > >
> > > #define __amd64 1
> > > #define __amd64__ 1
> > > #define __x86_64 1
> > > #define __x86_64__ 1
> > >
> > > as defined.
> > >
> > > It reports
> > >
> > > #define __aarch64__ 1
> > >
> > > on an 64 bit ARM CPU.
> > >
> >
> > 'man 7 arch' will tell you these things:
>
> better late than never.
>
> I still trust a compiler more than the documentation.
>

The compiler confirms the documentation :)

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


Re: #includes and #defined

2018-08-10 Thread Erich Dollansky
Hi,

On Fri, 10 Aug 2018 07:53:19 -0600
Warner Losh  wrote:

> On Thu, Aug 9, 2018 at 11:51 PM, Erich Dollansky <
> freebsd.ed.li...@sumeritec.com> wrote:  
> 
> > On Fri, 10 Aug 2018 12:40:48 +0800
> > blubee blubeeme  wrote:
> >  
> > >
> > > What about the architecture name is it recommended to use x86_64
> > > or amd64?  
> >
> > my clang reports on an Intel CPU:
> >
> > #define __amd64 1
> > #define __amd64__ 1
> > #define __x86_64 1
> > #define __x86_64__ 1
> >
> > as defined.
> >
> > It reports
> >
> > #define __aarch64__ 1
> >
> > on an 64 bit ARM CPU.
> >  
> 
> 'man 7 arch' will tell you these things:

better late than never.

I still trust a compiler more than the documentation.

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


Re: #includes and #defined

2018-08-10 Thread blubee blubeeme
On Fri, Aug 10, 2018 at 9:53 PM Warner Losh  wrote:

>
>
> On Thu, Aug 9, 2018 at 11:51 PM, Erich Dollansky <
> freebsd.ed.li...@sumeritec.com> wrote:
>
>> Hi,
>>
>> On Fri, 10 Aug 2018 12:40:48 +0800
>> blubee blubeeme  wrote:
>>
>> > On Fri, Aug 10, 2018 at 8:28 AM Erich Dollansky <
>> > freebsd.ed.li...@sumeritec.com> wrote:
>> >
>> > > Hi,
>> > >
>> > > On Fri, 10 Aug 2018 08:01:42 +0800
>> > > blubee blubeeme  wrote:
>> > >
>> > > > What's the proper way to define and include FreeBSD amd64 in GNU
>> > > > Makefiles
>> > > >
>> > > > Do we define FreeBSD as x86_64 or amd64 also is it __FreeBSD__,
>> > > > FreeBSD__, or __FreeBSD
>> > > >
>> > > > I've seen all of the above looking through different projects.
>> > >
>> > > clang defines '__FreeBSD__'
>> > >
>> > > Erich
>> > >
>> >
>> > What about the architecture name is it recommended to use x86_64 or
>> > amd64?
>>
>> my clang reports on an Intel CPU:
>>
>> #define __amd64 1
>> #define __amd64__ 1
>> #define __x86_64 1
>> #define __x86_64__ 1
>>
>> as defined.
>>
>> It reports
>>
>> #define __aarch64__ 1
>>
>> on an 64 bit ARM CPU.
>>
>
> 'man 7 arch' will tell you these things:
>
>amd64  __amd64__, __x86_64__
>
This is what I was looking for, thank you for the man page and it's good to
see that these things are starting to get documented.

>
> it contains the preferred list of macros to use. Ideally, you'd use the
> first one listed, though all the ones listed are supported. Others might
> not be.
>
> Warner
>

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


Re: #includes and #defined

2018-08-10 Thread Warner Losh
On Thu, Aug 9, 2018 at 11:51 PM, Erich Dollansky <
freebsd.ed.li...@sumeritec.com> wrote:

> Hi,
>
> On Fri, 10 Aug 2018 12:40:48 +0800
> blubee blubeeme  wrote:
>
> > On Fri, Aug 10, 2018 at 8:28 AM Erich Dollansky <
> > freebsd.ed.li...@sumeritec.com> wrote:
> >
> > > Hi,
> > >
> > > On Fri, 10 Aug 2018 08:01:42 +0800
> > > blubee blubeeme  wrote:
> > >
> > > > What's the proper way to define and include FreeBSD amd64 in GNU
> > > > Makefiles
> > > >
> > > > Do we define FreeBSD as x86_64 or amd64 also is it __FreeBSD__,
> > > > FreeBSD__, or __FreeBSD
> > > >
> > > > I've seen all of the above looking through different projects.
> > >
> > > clang defines '__FreeBSD__'
> > >
> > > Erich
> > >
> >
> > What about the architecture name is it recommended to use x86_64 or
> > amd64?
>
> my clang reports on an Intel CPU:
>
> #define __amd64 1
> #define __amd64__ 1
> #define __x86_64 1
> #define __x86_64__ 1
>
> as defined.
>
> It reports
>
> #define __aarch64__ 1
>
> on an 64 bit ARM CPU.
>

'man 7 arch' will tell you these things:

   amd64  __amd64__, __x86_64__

it contains the preferred list of macros to use. Ideally, you'd use the
first one listed, though all the ones listed are supported. Others might
not be.

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


Re: #includes and #defined

2018-08-09 Thread Erich Dollansky
Hi,

On Fri, 10 Aug 2018 12:40:48 +0800
blubee blubeeme  wrote:

> On Fri, Aug 10, 2018 at 8:28 AM Erich Dollansky <
> freebsd.ed.li...@sumeritec.com> wrote:  
> 
> > Hi,
> >
> > On Fri, 10 Aug 2018 08:01:42 +0800
> > blubee blubeeme  wrote:
> >  
> > > What's the proper way to define and include FreeBSD amd64 in GNU
> > > Makefiles
> > >
> > > Do we define FreeBSD as x86_64 or amd64 also is it __FreeBSD__,
> > > FreeBSD__, or __FreeBSD
> > >
> > > I've seen all of the above looking through different projects.  
> >
> > clang defines '__FreeBSD__'
> >
> > Erich
> >  
> 
> What about the architecture name is it recommended to use x86_64 or
> amd64?

my clang reports on an Intel CPU:

#define __amd64 1
#define __amd64__ 1
#define __x86_64 1
#define __x86_64__ 1

as defined.

It reports

#define __aarch64__ 1

on an 64 bit ARM CPU.

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


Re: #includes and #defined

2018-08-09 Thread blubee blubeeme
On Fri, Aug 10, 2018 at 8:28 AM Erich Dollansky <
freebsd.ed.li...@sumeritec.com> wrote:

> Hi,
>
> On Fri, 10 Aug 2018 08:01:42 +0800
> blubee blubeeme  wrote:
>
> > What's the proper way to define and include FreeBSD amd64 in GNU
> > Makefiles
> >
> > Do we define FreeBSD as x86_64 or amd64 also is it __FreeBSD__,
> > FreeBSD__, or __FreeBSD
> >
> > I've seen all of the above looking through different projects.
>
> clang defines '__FreeBSD__'
>
> Erich
>

What about the architecture name is it recommended to use x86_64 or amd64?

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


Re: #includes and #defined

2018-08-09 Thread Erich Dollansky
Hi,

On Fri, 10 Aug 2018 08:01:42 +0800
blubee blubeeme  wrote:

> What's the proper way to define and include FreeBSD amd64 in GNU
> Makefiles
> 
> Do we define FreeBSD as x86_64 or amd64 also is it __FreeBSD__,
> FreeBSD__, or __FreeBSD
> 
> I've seen all of the above looking through different projects.

clang defines '__FreeBSD__'

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