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

dxegen: unresolved symbol `___libemu_ident_string' #46

Open
jwt27 opened this issue Sep 26, 2024 · 4 comments
Open

dxegen: unresolved symbol `___libemu_ident_string' #46

jwt27 opened this issue Sep 26, 2024 · 4 comments

Comments

@jwt27
Copy link
Owner

jwt27 commented Sep 26, 2024

This error sporadically appears while building djgpp's libemu:

./../../hostbin/dxegen.exe ./../../bin/emu387.dxe __emu_entry src/emu387.o id_emu.o src/emudummy.o -L../../lib /Users/runner/work/build-gcc/build-gcc-ff86c9953a6116c1cb9aa26a63fd676875177e53/lib/gcc/i386-pc-msdosdjgpp/14.2.0/libgcc.a -lc /Users/runner/work/build-gcc/build-gcc-ff86c9953a6116c1cb9aa26a63fd676875177e53/lib/gcc/i386-pc-msdosdjgpp/14.2.0/libgcc.a
dxegen: unresolved symbol `___libemu_ident_string'
make: *** [../../bin/emu387.dxe] Error 253

Digging through the makefiles:

  • bin/emu387.dxe requires id_emu.o, but is not listed as prerequisite
  • id_emu.o is built in the recipe for lib/libemu.a
  • lib/libemu.a is built in the recipe for all:: in makefile.lib (via recursive make)
  • all:: in libemu/makefile lists bin/emu387.dxe as prerequisite

So there is a sort-of circular dependency, and whether this fails or not depends on the evaluation order of all::.
It probably works consistently with non-parallel make, but this still looks pretty fragile.

We don't actually need to build this though, the DXE is not currently installed anywhere. I suppose I could put it in i386-pc-msdosdjgpp/lib/ for completeness. For now, I think I'll drop libemu altogether. If anyone does need this, please complain below.

jwt27 added a commit that referenced this issue Sep 26, 2024
Workaround for #46.
@manxorist
Copy link

Wouldn't patching out the all:: bin/emu387.dxe prerequisite in libemu/makefile, and then building it as a separate make invocation afterwards like ${MAKE_J} -C libemu bin/emu387.dxe || exit 1 hack-around the problem? That could keep libemu support. Not a clean solution of course.
It may well be that I am missing something though :)

@jwt27
Copy link
Owner Author

jwt27 commented Sep 26, 2024

Yeah, I suppose that would work. In fact, I don't really see why both libemu.a and emu387.dxe need to have the exact same ident string, so another option is to just compile it twice:

--- a/src/libemu/makefile
+++ b/src/libemu/makefile
@@ -12,7 +12,8 @@ include $(TOP)/../makefile.lib
 all ::	$(BIN)/emu387.dxe
 
 $(BIN)/emu387.dxe : src/emu387.o src/emudummy.o
-	$(HOSTBIN)/dxegen.exe $(BIN)/emu387.dxe __emu_entry src/emu387.o id_emu.o src/emudummy.o -L../../lib $(LIBGCCA) -lc $(LIBGCCA)
+	$(CROSS_GCC) -c -DLIB=libemu $(TOP)/../ident.c -o id_emudxe.o
+	$(HOSTBIN)/dxegen.exe $(BIN)/emu387.dxe __emu_entry src/emu387.o id_emudxe.o src/emudummy.o -L../../lib $(LIBGCCA) -lc $(LIBGCCA)
 	
 clean ::
 	$(MISC) rm makefile.sub

@manxorist
Copy link

I guess that would also work, sure.

@SuperIlu
Copy link

well, I just noticed the missing libemu.a because I link against it.

is it possible to only build the static library?

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