Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails: enumtest.exe et al. #66

Open
edi-meier opened this issue Aug 21, 2013 · 7 comments
Open

Build fails: enumtest.exe et al. #66

edi-meier opened this issue Aug 21, 2013 · 7 comments

Comments

@edi-meier
Copy link

Today I tried to build master, as always with
../../data/aldor/aldor/configure --prefix=$HOME --with-boehm-gc --disable-java &> /dev/null ; echo $?
but 'time make -j&> make.log ; echo $?' fails:

gcc -L ... -o enumtest.exe enumtest-aldormain.o rtexns.o en0NXS00.o ...
aldor/src/store.c:4836: undefined reference to GC_malloc' aldor/src/store.c:4880: undefined reference toGC_realloc'
aldor/src/store.c:4855: undefined reference to `GC_free'
collect2: error: ld returned 1 exit status

".exe" on linux (?)

@edi-meier
Copy link
Author

The correct build-command was 'time make -j3 &> make.log ; echo $?'
I also tried a non-parallel build via 'time make &> make.log ; echo $?': same error

@pbroadbery
Copy link
Member

The .exe is just a convenient suffix for the makefile, it's only a name
after all. I'll teach the build about the extra library shortly. Until
then, comment out the "xtests =' line in the aldor/aldor/tests directory.

On Wed, Aug 21, 2013 at 7:12 PM, edi-meier [email protected] wrote:

The correct build-command was 'time make -j3 &> make.log ; echo $?'
I also tried a non-parallel build via 'time make &> make.log ; echo $?':
same error


Reply to this email directly or view it on GitHubhttps://github.com//issues/66#issuecomment-23037783
.

@edi-meier
Copy link
Author

ok, build succeeds with the line commented out.
Thank you!

@pbroadbery
Copy link
Member

Something of an issue here as to how boehm gc should be handled when aldor
compiles down to executables.
Options are:
0) Make sure that the compiler sticks -l options at the end of the link
command line. ld is rather sensitive about this kind of thing. Users will
need to add -lgc at the end of every aldor -fx command.

  1. It's a config option, so a build either supports it, or it doesn't.
    Basically, the one line hacky fix is
    aldor.conf line 223: "lib-extra = gc m" for boehm.
  2. Teach aldor to compile optionally compile boehm. Probably add an option
    like -Cboehm (except better named), and a spot of extra library building to
    produce libfoam-boehm.a

On the whole I think (2) is better, and not much more work, plus we can
test both configs at once.

Fixing the ld invocation to be in the right order is a slightly separate
issue - probably needs to be done anyway.

Peter

On Wed, Aug 21, 2013 at 8:53 PM, edi-meier [email protected] wrote:

ok, build succeeds with the line commented out


Reply to this email directly or view it on GitHubhttps://github.com//issues/66#issuecomment-23044970
.

@edi-meier
Copy link
Author

Compiling with clang and boehm now I just add the 3 lines

  cc-name   = cc
  link-name = cc
  link-opts = -L /usr/X11/lib -lgc

in aldor.conf in the "linux"-section before compiling aldor,
so the "xtests"-line works also.

Issue #76 is an "extension" of this issue here.

@pippijn
Copy link
Collaborator

pippijn commented Sep 4, 2013

Alternatively, split the runtime into C and aldor parts, so that we can have libruntime-boehm.so, linked to libgc, and then libfoam-boehm.a. Then, aldor -fx -Cruntime=boehm would link to those two libraries.

@edi-meier
Copy link
Author

Would your suggestion allows me to have "clang + boehm + hardening" together?
I ask because at the moment

  cc-name   = cc
  cc-opts   = -fPIE -O3
  link-name = cc
  link-opts = -L /usr/X11/lib -lgc -pie

doesn't work when compiling aldor, it wants a "-fPIC" for shared objects which then would result in

 Position Independent Executable: no, normal executable!
 Stack protected: yes
 Fortify Source functions: yes (some protected functions found)
 Read-only relocations: yes
 Immediate binding: yes

"only" for aldor-compiled binaries and not the desired

 Position Independent Executable: yes
 Stack protected: yes
 Fortify Source functions: yes (some protected functions found)
 Read-only relocations: yes
 Immediate binding: yes

Yes, after the compilation of aldor I could adapt "aldor.conf" for a second time but I would like to have it "in one go".
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants