Opened 11 years ago

Closed 11 years ago

#3375 closed bug (fixed)

New gcc 4.3.3 cross-compiler doesn't compile pci.cpp

Reported by: umccullough Owned by: mmlr
Priority: normal Milestone: R1
Component: Build System Version: R1/pre-alpha1
Keywords: Cc: tombhadAC@…
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

It seems that once mmlr had fixed the cross-compiler generate on linux (YAY!) - I was able to create the cross-tools.

However, it will not compile Haiku. (See attached output from compile)

It seems the previous gcc compiler had an extra gcc/gcc/config/t-haiku file with the following contents (scraped from my old build env):

umccullough@debsrv3:/work/haiku/buildtools/trunk/gcc/gcc/config$ cat t-haiku
# The LIMITS_H_TEST looks for limits.h in $(SYSTEM_HEADERS_DIR), but it is in
# .../posix.
LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/posix/limits.h ]

I am just guessing this is the cause of the failure - I will add it to my new environment to test.

Attachments (3)

pci-cpp-fail.txt (21.5 KB ) - added by umccullough 11 years ago.
build failure on pci.cpp
test-for-mmlr.txt (18.3 KB ) - added by tombhadAC 11 years ago.
test-for-mmlr2.txt (18.3 KB ) - added by tombhadAC 11 years ago.

Download all attachments as: .zip

Change History (22)

by umccullough, 11 years ago

Attachment: pci-cpp-fail.txt added

build failure on pci.cpp

comment:1 by umccullough, 11 years ago

I see that ingo originally fixed this in gcc4 back in hrev14998

I'm way out of my league here, but it seems limits.h isn't necessarily posix-specific - should it really be located there in the first place?

in reply to:  1 comment:2 by umccullough, 11 years ago

Replying to umccullough:

I see that ingo originally fixed this in gcc4 back in hrev14998

Oh that was actually t-beos...in any case, it seems t-haiku was a duplicate of that file.

comment:3 by umccullough, 11 years ago

putting the old t-haiku file into gcc/gcc/config and recreating the buildtools didn't help, so I guess some different fix is required now :)

in reply to:  3 comment:4 by mt, 11 years ago

Replying to umccullough:

putting the old t-haiku file into gcc/gcc/config and recreating the buildtools didn't help, so I guess some different fix is required now :)

I think change t-haiku path gcc/gcc/config to gcc/gcc/config/i386 as gcc/gcc/config.gcc reading gcc/gcc/config/i386.

i[34567]86-*-haiku*)
	tmake_file='i386/t-haiku i386/t-crtpic'
	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h haiku.h i386/haiku.h"
	extra_parts='crtbegin.o crtend.o'

comment:5 by mmlr, 11 years ago

The limits test is only local to the cross-compiler. It's not used afterwards when compiling with the cross-compiler. Can you please get me the output of:

/home/umccullough/haiku/haiku/trunk/generated/cross-tools/bin/i586-pc-haiku-gcc -c "src/add-ons/kernel/bus_managers/pci/pci.cpp" -O -Wall -Wno-trigraphs -Wno-multichar -pipe -fno-strict-aliasing -fno-tree-vrp -nostdinc -Wno-deprecated -D_ZETA_USING_DEPRECATED_API_=1 -D_ZETA_TS_FIND_DIR_=1 -pipe -fno-strict-aliasing -fno-tree-vrp -finline -fno-builtin -fno-exceptions -DBOCHS_DEBUG_HACK=0 -fno-use-cxa-atexit -ffreestanding -D_KERNEL_MODE -D__HAIKU__ -DHAIKU_DISTRO_COMPATIBILITY_DEFAULT -D__INTEL__ -DARCH_x86 -DBOOT_ARCHIVE_IMAGE_OFFSET=300 -DHAIKU_TARGET_PLATFORM_HAIKU -iquote build/user_config_headers -iquote build/config_headers -iquote src/add-ons/kernel/bus_managers/pci -iquote generated/objects/common/add-ons/kernel/bus_managers/pci -iquote generated/objects/linux/x86/common/add-ons/kernel/bus_managers/pci -iquote generated/objects/haiku/x86/common/add-ons/kernel/bus_managers/pci -I headers/private/. -I headers/private/kernel -I headers/private/libroot -I headers/private/kernel/boot/platform/bios_ia32 -I headers/private/kernel/arch/x86 -I headers/private/. -I headers/private/system -I headers/private/system/arch/x86 -I headers/private/shared -I headers/private/kernel/util -I /home/umccullough/haiku/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/../../../../include/c++/4.3.3 -I /home/umccullough/haiku/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/../../../../include/c++/4.3.3/i586-pc-haiku -I /home/umccullough/haiku/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/../../../../include/c++/4.3.3/backward -I /home/umccullough/haiku/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/../../../../include/c++/4.3.3/ext -I /home/umccullough/haiku/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.3.3/include -I headers -I headers/posix -I headers/gnu -I headers/glibc -I headers/os -I headers/os/add-ons -I headers/os/add-ons/file_system -I headers/os/add-ons/graphics -I headers/os/add-ons/input_server -I headers/os/add-ons/registrar -I headers/os/add-ons/screen_saver -I headers/os/add-ons/tracker -I headers/os/app -I headers/os/device -I headers/os/drivers -I headers/os/game -I headers/os/interface -I headers/os/kernel -I headers/os/media -I headers/os/mail -I headers/os/midi -I headers/os/midi2 -I headers/os/net -I headers/os/opengl -I headers/os/storage -I headers/os/support -I headers/os/translation -I headers/private/. -o "generated/objects/haiku/x86/release/add-ons/kernel/bus_managers/pci/pci.o" -v

It should dump the directories in use.

by tombhadAC, 11 years ago

Attachment: test-for-mmlr.txt added

comment:6 by mt, 11 years ago

HI, I'm testing build haiku with moving limits.h and syslimits.h from /cross-tools/lib/gcc/i586-pc-haiku/4.3.3/include-fixed to /cross-tools/lib/gcc/i586-pc-haiku/4.3.3/include and seems to build haiku fine.

comment:7 by mmlr, 11 years ago

That's what I though. It's a missing include path config in gcc/gcc/config/haiku.h. I'm just not yet sure which one. It should be there actually, but maybe it's pointing to a wrong path. That's why I need the "-v" output of the above command.

comment:8 by tombhadAC, 11 years ago

Cc: tombhadAC@… added

mmlr, look at my attachment.

comment:9 by mmlr, 11 years ago

Oh, missed that one. Thanks, it seems that the FIXED_INCLUDE_DIR just doesn't trigger. Will investigate.

comment:10 by mmlr, 11 years ago

Owner: changed from bonefish to mmlr
Status: newassigned

Can you please retry with a current revision. The include-fixed directory was just missing from our configure script.

by tombhadAC, 11 years ago

Attachment: test-for-mmlr2.txt added

comment:11 by tombhadAC, 11 years ago

Seems to be still the same.

comment:12 by herdemir, 11 years ago

I was getting errors also with limits.h before, but not in pci.cpp but driver/common/console.cpp. With the current build (hrev29072) limits.h specific problem did disappear, but I still cannot build with gcc4. It builds fine with gcc2. The error happens when i try to comple Haiku with gcc4. Here is the following error:

C++ generated/objects/haiku/x86/release/add-ons/kernel/drivers/common/console.o 
In file included from headers/os/drivers/KernelExport.h:10,
                 from src/add-ons/kernel/drivers/common/console.cpp:11:
headers/os/kernel/OS.h:691: error: 'NAME_MAX' was not declared in this scope
src/add-ons/kernel/drivers/common/console.cpp:75: error: 'NAME_MAX' was not declared in this scope
src/add-ons/kernel/drivers/common/console.cpp: In function 'status_t console_open(const char*, uint32, void**)':
src/add-ons/kernel/drivers/common/console.cpp:634: error: 'struct console_desc' has no member named 'module_name'
src/add-ons/kernel/drivers/common/console.cpp: In function 'status_t console_freecookie(void*)':
src/add-ons/kernel/drivers/common/console.cpp:646: error: 'struct console_desc' has no member named 'module_name'
src/add-ons/kernel/drivers/common/console.cpp: In function 'status_t init_hardware()':
src/add-ons/kernel/drivers/common/console.cpp:736: error: 'NAME_MAX' was not declared in this scope
src/add-ons/kernel/drivers/common/console.cpp:737: error: 'buffer' was not declared in this scope
src/add-ons/kernel/drivers/common/console.cpp:742: error: 'struct console_desc' has no member named 'module_name'
src/add-ons/kernel/drivers/common/console.cpp:742: error: 'struct console_desc' has no member named 'module_name'

comment:13 by anevilyak, 11 years ago

I still fail on pci.cpp here as well, albeit with the NAME_MAX error. Also note that for me the c++ header dir still appears to not be getting included correctly, as it's also complaining about not finding <new>.

comment:14 by aldeck, 11 years ago

Same here. ubuntu 8.10 32bits gcc 4.3.2, source and buildtools at hrev29073

Cc generated/objects/haiku/x86/release/add-ons/kernel/bus_managers/pci/pci_module.o 
In file included from src/add-ons/kernel/bus_managers/pci/pci.cpp:14:
headers/private/kernel/util/kernel_cpp.h:11:15: error: new: No such file or directory
In file included from headers/private/kernel/util/VectorMap.h:36,
                 from src/add-ons/kernel/bus_managers/pci/pci.h:13,
                 from src/add-ons/kernel/bus_managers/pci/pci_info.cpp:13:
headers/private/kernel/util/kernel_cpp.h:11:15: error: new: No such file or directory
In file included from headers/os/drivers/KernelExport.h:10,
                 from src/add-ons/kernel/bus_managers/pci/pci.cpp:10:
headers/os/kernel/OS.h:691: error: 'NAME_MAX' was not declared in this scope
In file included from src/add-ons/kernel/bus_managers/pci/pci.cpp:14:
headers/private/kernel/util/kernel_cpp.h:17: error: 'nothrow_t' does not name a type
headers/private/kernel/util/kernel_cpp.h:27: error: expected type-specifier
headers/private/kernel/util/kernel_cpp.h:27: error: expected `)'
headers/private/kernel/util/kernel_cpp.h:27: error: expected initializer
headers/private/kernel/util/kernel_cpp.h:37: error: expected type-specifier
headers/private/kernel/util/kernel_cpp.h:37: error: expected `)'
headers/private/kernel/util/kernel_cpp.h:37: error: expected initializer
headers/private/kernel/util/kernel_cpp.h:44: error: expected unqualified-id before '&' token
headers/private/kernel/util/kernel_cpp.h:44: error: expected ',' or '...' before '&' token
headers/private/kernel/util/kernel_cpp.h:51: error: expected unqualified-id before '&' token
headers/private/kernel/util/kernel_cpp.h:51: error: expected ',' or '...' before '&' token

comment:15 by anevilyak, 11 years ago

After massaging build/BuildConfig a bit (the path to the C++ headers was missing i586-pc-haiku), I got far enough to look at the output with gcc -E. The problem appears to be that include-fixed/limits.h is found first, and that file does nothing to try and include the system-specific limits.h, at least I see no include/include_next directives in there.

Adding a #include_next <limits.h> to that file (and commenting out the include_next in posix/limits.h) gets it building further for me.

comment:16 by anevilyak, 11 years ago

On a related note, does gdb need to be updated to cope with the newer ABI, or is ours new enough to handle it already?

comment:17 by mmlr, 11 years ago

I messed it up. The include-fixed/limits.h is supposed to hide the system one, because it should be a "fixed" version of the system limits.h. The problem was that it wasn't found (because I removed the config addition as it wasn't needed for native compilation) and a GCC supplied one was put there instead. Should be fixed in hrev29076. Please check.

comment:18 by aldeck, 11 years ago

Works now! kudos :)

hrev29078

comment:19 by mmlr, 11 years ago

Resolution: fixed
Status: assignedclosed

Thanks for the feedback. Closing.

Note: See TracTickets for help on using tickets.