Closed Bug 437215 Opened 17 years ago Closed 17 years ago

XPIDL cross compile config error

Categories

(Firefox Build System :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: Techrazy.Yang, Unassigned)

Details

Attachments

(1 file)

Now, in cross compile, we did not create the target xpidl file. This is written in the file: xpcom/typelib/xpidl/Makefile.in like following: # Cross-compiling # Don't build xpidl for the target. This is not intended to be a permanent # solution. It's necessary because it is presently difficult to build # xpidl's prerequisites (libIDL and glib) as fat and suitable for a cross. # This will be fixed. -mm But when I make a cross compile on Linux for mingw32, the build system start to make a target xpidl because some of the wrong Makefile.in config. And this patch is used to repair it.
Attachment #323715 - Flags: review?(benjamin)
Comment on attachment 323715 [details] [diff] [review] Patch to disable building target xpidl when we are not building for WINCE Hrm. Normally when cross-compiling you should have the target libidl/glib as well as the host libidl/glib... is that not the case? That way we will produce both a target xpidl binary as well as a host host_xpidl binary.
(In reply to comment #1) > (From update of attachment 323715 [details] [diff] [review]) > Hrm. Normally when cross-compiling you should have the target libidl/glib as > well as the host libidl/glib... is that not the case? That way we will produce > both a target xpidl binary as well as a host host_xpidl binary. > Yeah, but the comment said, we will do this later. Maybe it is time to do this. We need both host and target xpidl. I think I can figure out a solution, can I take this bug?
So, there are people who cross-compile for mingw already without this change, so I don't understand why any change at all is required.
(In reply to comment #3) > So, there are people who cross-compile for mingw already without this change, > so I don't understand why any change at all is required. En, I have cross-compiled Mozilla with Mingw without this change, too. But I need to set some LIBIDL_CFLAGS and LDFLAGS evn variables to make the cross-compiler to find the right headers and libraries of libIDL and glib for the target platform. And I think that is just a workaround. And, I don't find any document/manual about cross-compiling mingw. Could you please give me some URLs about how to cross-compile with mingw if you have seen? Thanks very much!
http://www.mozilla.org/build/cross-compiling.html has the general cross-compiling instructions. Important is the section about "Cross-compile glib, libIDL & gtk+" Assuming you have cross-compiling enabled properly, configure should be setting HOST_LIBIDL_CFLAGS and HOST_LIBIDL_LIBS separately from LIBIDL_CFLAGS and LIBIDL_LIBS, see the configure block at http://mxr.mozilla.org/mozilla/source/configure.in#7210
Comment on attachment 323715 [details] [diff] [review] Patch to disable building target xpidl when we are not building for WINCE You're welcome to hack this locally if that unblocks other work, but I don't think it's correct.
Attachment #323715 - Flags: review?(benjamin) → review-
(In reply to comment #5) > http://www.mozilla.org/build/cross-compiling.html has the general > cross-compiling instructions. Important is the section about "Cross-compile > glib, libIDL & gtk+" > Assuming you have cross-compiling enabled properly, configure should be setting > HOST_LIBIDL_CFLAGS and HOST_LIBIDL_LIBS separately from LIBIDL_CFLAGS and > LIBIDL_LIBS, see the configure block at > http://mxr.mozilla.org/mozilla/source/configure.in#7210 > I still feel there is something wrong in two place. One is at xpcom/typelib/xpidl/Makefile.in: At http://mxr.mozilla.org/mozilla/source/xpcom/typelib/xpidl/Makefile.in#47, it said it will compile a Program for non-WINCE platform whether we are cross-compiling or not. But at http://mxr.mozilla.org/mozilla/source/xpcom/typelib/xpidl/Makefile.in#97, it said we will not produe an XPIDL for target platform, so the following code http://mxr.mozilla.org/mozilla/source/xpcom/typelib/xpidl/Makefile.in#105 set the PROGRAM to NULL. I think the above two parts of code are conflicting to each other. The result is for non-WINCE platform, we always has a target XPIDL compiled whether we are cross-compiling. And this absolutely conflicts with the the comments at http://mxr.mozilla.org/mozilla/source/xpcom/typelib/xpidl/Makefile.in#97. And I think, my patch will remove the conflict and make sure there is no target XPIDL produced when cross-compiling. Just like the the comment said. So, I think maybe the comment should be removed or there is a logic confilt here. The second one is at the configure.in. From your reply, I think you must want both the HOST and TARGET XPIDL to compiled when cross-compiling. And I think that should be this case, too. And, compiling target XPIDL needs the libIDL/glib for the target platform. I can use LIBIDL_CFLAGS to set the headers of the target platform's libIDL/glib. But I find the LIBIDL_LIBS did not work at all.I mean, by adding a LIBIDL_LIBS in .mozconfig file, it affect nothing to the compiling progress. I think it is better to make sure the two VAR are all workable. And further more, I think specifying where to find the target platform's libIDL/glib headers and libs through configure's options may be better than just set the env variables. How do you think about this?
Regarding the first problem, you're comparing 2 platform-specific assignments that do not apply to this case. For WINCE (line 47), building xpidl is disabled for the target platform due to WINCE-specific compiler issue. For Darwin/OSX (line 97), building xpidl is also disabled for the target due to the reasons listed in the Makefile. Regarding the second problem, the default scenario when cross-compiling is to build both the host & target versions of xpidl. A properly configured mingw32 cross-compiled build will already do this. I believe your specific build issues come from setting LIBIDL_CFLAGS/LIBS in .config rather than setting LIBIDL_CONFIG and using the -config scripts. While setting those variable may work sometimes, configure was designed to use the -config script (or pkg-config output) when possible so it's very likely that configure is overriding the settings from the .mozconfig. When cross-compiling, you will need to specify HOST_LIBIDL_CONFIG as the cross-compiling document states.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → INVALID
Component: Build Config → General
Product: Firefox → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: