bugGNU Common Lisp - Bugs: bug #43772, Crosscompiling does not work

 
 

bug #43772: Crosscompiling does not work

Submitter:  None
Submitted:  Sun 07 Dec 2014 03:25:55 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Wont Fix
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 10 Nov 2022 01:52:58 PM UTC, comment #3: 

Greetings, and thanks so much for your feedback!  This code is meant to avoid including secondary headers in cmpinclude.h for compiler performance purposes.  We just need this one value from setjmp.h.  We could as you suggest avoid the runtime check in configure in favor of some rule in a makefile to get the value. 

But the general problem of cross compiling is quite deep. The biggest issue is sbrk randomization detection, which I see no way around.  As long as this problem exists, other cross compilation fixes in configure.in are moot, alas.  I am most open to suggestions if I have overlooked something.  Please feel free to reopen if you have such an insight.

Take care,

Camm Maguire <camm>
Group administrator
Wed 10 Dec 2014 05:30:22 PM UTC, comment #2: 

Hi,

I do not know much about autoconf/automake, but why is the checking done instead of just using sizeof()?

So for the first problem: checking sizeof jmp_buf


You compile and (try to) run at test program, which writes the result of
sizeof(jmp_buf)
in a file (conftest1), then it reads that file and generates a

#define SIZEOF_JMP_BUF <value read from conftest1>
in the file "h/gclincl.h"

That value is then used in "h/frame.h":
char     frs_jmpbuf[SIZEOF_JMP_BUF] _attribute_ ((_aligned_ (OBJ_ALIGNMENT*2)));

But you could just define the valute of sizeof(jmp_buf):
#define SIZEOF_JMP_BUF sizeof(jmp_buf)

(you may need to #include <setjmp.h> - as in the test program)

Or just write

char     frs_jmpbuf[sizeof(jmp_buf)] _attribute_ ((_aligned_ (OBJ_ALIGNMENT*2)));
in "h/frame.h".

Shouldn't that be easier?

Best regards, Wolfgang


Anonymous
Tue 09 Dec 2014 09:12:36 PM UTC, comment #1: 

Greetings, and thanks for your report!

So what is the canonical way to determine runtime compiler constants, say, when cross compiling?  We need variable sizes, heap/stack locations and limits, etc.

Camm Maguire <camm>
Group administrator
Sun 07 Dec 2014 03:25:55 PM UTC, original submission:  

The "configure"-script tries to run binaries for tests, which is not possible, if one tries to crosscompile gcl, e.g.:


./configure --host=i686-w64-mingw32
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking build system type... x86_64-unknown-linux-gnu
checking host system type... i686-w64-mingw32
host=i686-w64-mingw32
[...]
checking sizeof jmp_buf... configure: error: in `/tmp/gcl':
configure: error: cannot run test program while cross compiling
See `config.log' for more details

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by camm (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-11-10 camm StatusNone Wont Fix
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code