Re: GMP bug (?) - unable to build for ARM64 with assembly enabled

2020-10-28 Thread Andreas Buff


Am 16.10.20 um 11:48 schrieb Torbjörn Granlund:
> Andreas Buff  writes:
>
>thanks to your help, its building fine now without --disable-assembly,
>but it crashes using it.
>
>I am totally not into ASM, so forgive unqualified report(s).
>
>Here is the backtrace:
>
>* thread #8, queue = 'PEPAsyncSession.queue', stop reason =
>EXC_BAD_ACCESS (code=2, address=0x16fbcc000)
>   * frame #0: 0x0001019baf58 PEPObjCAdapterFramework`__gmpn_add_n + 
> 144
>     frame #1: 0x0001019babe4 PEPObjCAdapterFramework`__gmpn_add + 68
>     frame #2: 0x0001019e756c
>PEPObjCAdapterFramework`__gmpn_toom2_sqr + 1020
>     frame #3: 0x0001019c8030 PEPObjCAdapterFramework`__gmpn_sqr + 144
>     frame #4: 0x0001019fe838 PEPObjCAdapterFramework`__gmpn_powm + 
> 3416
>     frame #5: 0x0001019b5678 PEPObjCAdapterFramework`__gmpz_powm + 
> 2432
>
>Let me know if and how to provide more useful information if needed.
>
> Your report is scarce of detail.  Perhaps there is a bug in your
> program?
>
> Another possibility is that GMP does not work right on Ios.  Since that
> is a closed platform where developers need to pay Apple for programming,
> you cannot excpect any effort from the GMP team with regards to
> development or testing of GMP for Ios.
>
> If somebody who pays the Apple programmer tax is willing to help you
> debug your crash, we will certainly look at whatever GMP change might be
> needed.
>
Haha, fair enough, thanks :-)

JFYI: I can confirm GMP works fine on iOS with ASM disabled.





pEpkey.asc
Description: application/pgp-keys
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: GMP bug (?) - unable to build for ARM64 with assembly enabled

2020-10-16 Thread Andreas Buff
Hi Marco,

thanks to your help, its building fine now without --disable-assembly,  
but it crashes using it.

I am totally not into ASM, so forgive unqualified report(s).

Here is the backtrace:

* thread #8, queue = 'PEPAsyncSession.queue', stop reason =  
EXC_BAD_ACCESS (code=2, address=0x16fbcc000)
   * frame #0: 0x0001019baf58 PEPObjCAdapterFramework`__gmpn_add_n + 144
     frame #1: 0x0001019babe4 PEPObjCAdapterFramework`__gmpn_add + 68
     frame #2: 0x0001019e756c  
PEPObjCAdapterFramework`__gmpn_toom2_sqr + 1020
     frame #3: 0x0001019c8030 PEPObjCAdapterFramework`__gmpn_sqr + 144
     frame #4: 0x0001019fe838 PEPObjCAdapterFramework`__gmpn_powm + 3416
     frame #5: 0x0001019b5678 PEPObjCAdapterFramework`__gmpz_powm + 2432

Let me know if and how to provide more useful information if needed.

Thanks,
Andreas

Am 15.10.20 um 13:57 schrieb Andreas Buff:
> Hi Marco,
>
>
> Am 14.10.20 um 22:21 schrieb Torbjörn Granlund:
>> Marco Bodrato  writes:
>>
>> Look for a filename starting with gmp-6.2.0-202010...
>>
>> Then please follow up here!
>>
>> I changed how snapshots are managed.
>>
>> 1. There are now subdirs for each release series, plus "gmp-next".  The
>>  latter is made from the bleeding edge repo.
>>
>> 2. We have had an idea of an "active" repo, which is the same as the
>>  autobuilds use.  Now, both that active repo and the bleeding edge
>>  repo will have snapshots manufactured once per day.
>>
>> I've long planned to change the snapshot mechanism even more:
>>
>> 3. Make snapshots just after checkins and only after checkins which pass
>> some tests.  If n checkins are made in a day, n snapshots are made,
>> where n might be 0.
>>
>> 4. Do that for all GMP repos
> Using the latest snapshot (6.2.99-20201015) fixed the issue.
>
> Thx! A lot!
>




pEpkey.asc
Description: application/pgp-keys
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: GMP bug (?) - unable to build for ARM64 with assembly enabled

2020-10-16 Thread Torbjörn Granlund
Andreas Buff  writes:

  thanks to your help, its building fine now without --disable-assembly,  
  but it crashes using it.

  I am totally not into ASM, so forgive unqualified report(s).

  Here is the backtrace:

  * thread #8, queue = 'PEPAsyncSession.queue', stop reason =  
  EXC_BAD_ACCESS (code=2, address=0x16fbcc000)
     * frame #0: 0x0001019baf58 PEPObjCAdapterFramework`__gmpn_add_n + 144
       frame #1: 0x0001019babe4 PEPObjCAdapterFramework`__gmpn_add + 68
       frame #2: 0x0001019e756c  
  PEPObjCAdapterFramework`__gmpn_toom2_sqr + 1020
       frame #3: 0x0001019c8030 PEPObjCAdapterFramework`__gmpn_sqr + 144
       frame #4: 0x0001019fe838 PEPObjCAdapterFramework`__gmpn_powm + 3416
       frame #5: 0x0001019b5678 PEPObjCAdapterFramework`__gmpz_powm + 2432

  Let me know if and how to provide more useful information if needed.

Your report is scarce of detail.  Perhaps there is a bug in your
program?

Another possibility is that GMP does not work right on Ios.  Since that
is a closed platform where developers need to pay Apple for programming,
you cannot excpect any effort from the GMP team with regards to
development or testing of GMP for Ios.

If somebody who pays the Apple programmer tax is willing to help you
debug your crash, we will certainly look at whatever GMP change might be
needed.

-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: GMP bug (?) - unable to build for ARM64 with assembly enabled

2020-10-15 Thread Andreas Buff
Hi Marco,


Am 14.10.20 um 22:21 schrieb Torbjörn Granlund:
> Marco Bodrato  writes:
>
>Look for a filename starting with gmp-6.2.0-202010...
>
>Then please follow up here!
>
> I changed how snapshots are managed.
>
> 1. There are now subdirs for each release series, plus "gmp-next".  The
> latter is made from the bleeding edge repo.
>
> 2. We have had an idea of an "active" repo, which is the same as the
> autobuilds use.  Now, both that active repo and the bleeding edge
> repo will have snapshots manufactured once per day.
>
> I've long planned to change the snapshot mechanism even more:
>
> 3. Make snapshots just after checkins and only after checkins which pass
> some tests.  If n checkins are made in a day, n snapshots are made,
> where n might be 0.
>
> 4. Do that for all GMP repos
Using the latest snapshot (6.2.99-20201015) fixed the issue.

Thx! A lot!



pEpkey.asc
Description: application/pgp-keys
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: GMP bug (?) - unable to build for ARM64 with assembly enabled

2020-10-14 Thread Andreas Buff


Am 14.10.20 um 15:38 schrieb Marc Glisse:
> On Wed, 14 Oct 2020, Andreas Buff wrote:
>
>> Using host `aarch64-apple-darwin` gives me "unknown AArch64 fixup kind!"
>> errors.
>
> There was a discussion related to arm64 and apple in july, did you try 
> with a recent snapshot from https://gmplib.org/download/snapshot/ ?
>
Will try. I am using 6.2.0

Latest snapshot is from may though (re "discussion related to arm64 and 
apple in july").

Will come back with results.

Thx!




pEpkey.asc
Description: application/pgp-keys
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: GMP bug (?) - unable to build for ARM64 with assembly enabled

2020-10-14 Thread Hans Åberg

> On 14 Oct 2020, at 12:59, Andreas Buff  wrote:
> 
> We are cross building GMP for use on ARM64 iOS devices using this command:
> …

This link suggests using the -target option for makefiles outside Xcode.

https://developer.apple.com/documentation/xcode/building_a_universal_macos_binary


___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: GMP bug (?) - unable to build for ARM64 with assembly enabled

2020-10-14 Thread Torbjörn Granlund
Marco Bodrato  writes:

  Look for a filename starting with gmp-6.2.0-202010...

  Then please follow up here!

I changed how snapshots are managed.

1. There are now subdirs for each release series, plus "gmp-next".  The
   latter is made from the bleeding edge repo.

2. We have had an idea of an "active" repo, which is the same as the
   autobuilds use.  Now, both that active repo and the bleeding edge
   repo will have snapshots manufactured once per day.

I've long planned to change the snapshot mechanism even more:

3. Make snapshots just after checkins and only after checkins which pass
some tests.  If n checkins are made in a day, n snapshots are made,
where n might be 0.

4. Do that for all GMP repos.


-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: GMP bug (?) - unable to build for ARM64 with assembly enabled

2020-10-14 Thread Marco Bodrato

Il 2020-10-14 21:28 t...@gmplib.org ha scritto:

Andreas Buff  writes:

  Latest snapshot is from may though



There is one made every day.


Look for a filename starting with gmp-6.2.0-202010...

Then please follow up here!

Ĝis,
m
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: GMP bug (?) - unable to build for ARM64 with assembly enabled

2020-10-14 Thread Torbjörn Granlund
Andreas Buff  writes:

  Latest snapshot is from may though

Not quite.  Look better.

There is one made every day.

-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: GMP bug (?) - unable to build for ARM64 with assembly enabled

2020-10-14 Thread Andreas Buff
Hi,

thanks (!) for useful and fast response.

See below.

Best,
Andreas


Am 14.10.20 um 14:50 schrieb Marc Glisse:
> On Wed, 14 Oct 2020, Andreas Buff wrote:
>
>> We are cross building GMP for use on ARM64 iOS devices using this 
>> command:
>>
>> ```
>> export CFLAGS="-arch ${ARCH} -isysroot ${SDK_PATH}
>> -miphoneos-version-min=${MIN_IOS_VERSION} -std=c99"
>> export LDFLAGS="-arch ${ARCH}"
>> export CC="$(whereis gcc) -arch ${ARCH} -isysroot ${SDK_PATH}"
>>
>> PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
>> ./configure --host=${HOST} --prefix=$PREFIX
>> make -j4
>> make install
>> ```
>>
>> Where:
>> ${ARCH}="arm64"
>> ${SDK_PATH}=path to iOS14 SDK (failed also wirth previous SDK versions
>> MIN_IOS_VERSION="11.0"
>> ${HOST}="arm-apple-darwin"
>
> That triplet looks like 32 bits to me, don't you mean something like 
> aarch64 or arm64 instead of arm there?

Ah, Good catch.

Using host `aarch64-apple-darwin` gives me "unknown AArch64 fixup kind!" 
errors.

Find relevant part of the log attached.

tmp-bdiv_q_1.s:75:2: libtool: compile:  
/Applications/Xcode_11.6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -arch arm64 -isysroot 
/Applications/Xcode_11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk
 -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_sbpi1_bdiv_r 
-arch arm64 -isysroot 
/Applications/Xcode_11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk
 -miphoneos-version-min=11.0 -std=c99 -c sbpi1_bdiv_r.c  -fno-common -DPIC -o 
.libs/sbpi1_bdiv_r.o
libtool: compile:  
/Applications/Xcode_11.6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -arch arm64 -isysroot 
/Applications/Xcode_11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk
 -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_sbpi1_bdiv_qr 
-arch arm64 -isysroot 
/Applications/Xcode_11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk
 -miphoneos-version-min=11.0 -std=c99 -c sbpi1_bdiv_qr.c -o sbpi1_bdiv_qr.o 
>/dev/null 2>&1
libtool: compile:  
/Applications/Xcode_11.6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -arch arm64 -isysroot 
/Applications/Xcode_11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk
 -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_sbpi1_bdiv_r 
-arch arm64 -isysroot 
/Applications/Xcode_11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk
 -miphoneos-version-min=11.0 -std=c99 -c sbpi1_bdiv_r.c -o sbpi1_bdiv_r.o 
>/dev/null 2>&1
libtool: compile:  
/Applications/Xcode_11.6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -arch arm64 -isysroot 
/Applications/Xcode_11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk
 -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_dcpi1_bdiv_q 
-arch arm64 -isysroot 
/Applications/Xcode_11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk
 -miphoneos-version-min=11.0 -std=c99 -c dcpi1_bdiv_q.c  -fno-common -DPIC -o 
.libs/dcpi1_bdiv_q.o
error: /bin/sh ../libtool  --tag=CC   --mode=compile 
/Applications/Xcode_11.6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -arch arm64 -isysroot 
/Applications/Xcode_11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk
 -DHAVE_CONFIG_H -I. -I..  -D__GMP_WITHIN_GMP -I.. -DOPERATION_`echo 
dcpi1_bdiv_qr | sed 's/_$//'`   -arch arm64 -isysroot 
/Applications/Xcode_11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk
 -miphoneos-version-min=11.0 -std=c99 -c -o dcpi1_bdiv_qr.lo dcpi1_bdiv_qr.c
ADR/ADRP relocations must be GOT relative
 adrp x7, :got:__gmp_binvert_limb_table
 ^
tmp-bdiv_q_1.s:75:2: error: unknown AArch64 fixup kind!
/bin/sh ../libtool  --tag=CC   --mode=compile 
/Applications/Xcode_11.6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -arch arm64 -isysroot 
/Applications/Xcode_11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk
 -DHAVE_CONFIG_H -I. -I..  -D__GMP_WITHIN_GMP -I.. -DOPERATION_`echo mu_bdiv_q 
| sed 's/_$//'`   -arch arm64 -isysroot 
/Applications/Xcode_11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk
 -miphoneos-version-min=11.0 -std=c99 -c -o mu_bdiv_q.lo mu_bdiv_q.c
libtool: compile:  
/Applications/Xcode_11.6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -arch arm64 -isysroot 
/Applications/Xcode_11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk
 -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_dcpi1_bdiv_qr 
-arch arm64 -isysroot 

Re: GMP bug (?) - unable to build for ARM64 with assembly enabled

2020-10-14 Thread Marc Glisse

On Wed, 14 Oct 2020, Andreas Buff wrote:


Using host `aarch64-apple-darwin` gives me "unknown AArch64 fixup kind!"
errors.


There was a discussion related to arm64 and apple in july, did you try 
with a recent snapshot from https://gmplib.org/download/snapshot/ ?


--
Marc Glisse
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: GMP bug (?) - unable to build for ARM64 with assembly enabled

2020-10-14 Thread Marc Glisse

On Wed, 14 Oct 2020, Andreas Buff wrote:


We are cross building GMP for use on ARM64 iOS devices using this command:

```
export CFLAGS="-arch ${ARCH} -isysroot ${SDK_PATH}
-miphoneos-version-min=${MIN_IOS_VERSION} -std=c99"
export LDFLAGS="-arch ${ARCH}"
export CC="$(whereis gcc) -arch ${ARCH} -isysroot ${SDK_PATH}"

PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
./configure --host=${HOST} --prefix=$PREFIX
make -j4
make install
```

Where:
${ARCH}="arm64"
${SDK_PATH}=path to iOS14 SDK (failed also wirth previous SDK versions
MIN_IOS_VERSION="11.0"
${HOST}="arm-apple-darwin"


That triplet looks like 32 bits to me, don't you mean something like 
aarch64 or arm64 instead of arm there?


--
Marc Glisse
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs