Opened 17 years ago

Closed 14 years ago

Last modified 14 years ago

#189 closed defect (invalid)

emxomfar cannot build big libraries for Mozilla

Reported by: Yuri Dario Owned by: bird
Priority: normal Milestone: libc-0.6.4
Component: emx Version: 0.6.2
Severity: normal Keywords:
Cc:

Description

Build of static libs for Mozilla fails with 'Source library too big'. Looking at code, this patch

Index: omflibcl.c
===================================================================
--- omflibcl.c	(revision 3612)
+++ omflibcl.c	(working copy)
@@ -22,14 +22,14 @@
   /* Build a vector which maps page numbers to module table
      entries. */
 
-  reverse = malloc (65536 * sizeof (*reverse));
+  reverse = malloc (65536*2 * sizeof (*reverse));
   if (reverse == NULL)
     {
       errno = ENOMEM;
       return omflib_set_error (error);
     }
 
-  for (i = 0; i < 65536; ++i)
+  for (i = 0; i < 65536*2; ++i)
     reverse[i] = -1;
   for (i = 0; i < src->mod_count; ++i)
     reverse[src->mod_tab[i].page] = i;
@@ -46,7 +46,7 @@
           free (reverse);
           return -1;
         }
-      if (long_page > 65535)
+      if (long_page > (65536*2-1))
         {
           strcpy (error, "Source library too big");
           free (reverse);

fixed Peter build problems. I only doubled the number of entries, I don't know if this is the best fix.

Change History (3)

comment:1 by bird, 14 years ago

Status: newassigned

comment:2 by bird, 14 years ago

Resolution: invalid
Status: assignedclosed

I don't think the proposed patch makes much sense as I think there can only be 65536 page in an OMF library. The fix is to increase the page size as that is how long_page is calculated.

comment:3 by dryeo, 14 years ago

Just to be clear, patching mozilla/configure.in like so

-AR=emxomfar
+AR=emxomfar -p256

Seems to work

Note: See TracTickets for help on using tickets.