Ticket #3375 (closed bug: fixed)

Opened 14 months ago

Last modified 14 months ago

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: Platform: All
Blocking:

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

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

Change History

Changed 14 months ago by umccullough

build failure on pci.cpp

follow-up: ↓ 2   Changed 14 months ago by umccullough

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

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   Changed 14 months ago by umccullough

Replying to umccullough:

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

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

follow-up: ↓ 4   Changed 14 months ago by 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 :)

in reply to: ↑ 3   Changed 14 months ago by mt

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'

  Changed 14 months ago by mmlr

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.

Changed 14 months ago by tombhadAC

  Changed 14 months ago by mt

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.

  Changed 14 months ago by mmlr

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.

  Changed 14 months ago by tombhadAC

  • cc tombhadAC@… added

mmlr, look at my attachment.

  Changed 14 months ago by mmlr

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

  Changed 14 months ago by mmlr

  • owner changed from bonefish to mmlr
  • status changed from new to assigned

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

Changed 14 months ago by tombhadAC

  Changed 14 months ago by tombhadAC

Seems to be still the same.

  Changed 14 months ago by herdemir

I was getting errors also with limits.h before, but not in pci.cpp but driver/common/console.cpp. With the current build (r29072) 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'

  Changed 14 months ago by anevilyak

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>.

  Changed 14 months ago by aldeck

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

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

  Changed 14 months ago by anevilyak

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.

  Changed 14 months ago by anevilyak

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?

  Changed 14 months ago by mmlr

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 r29076. Please check.

  Changed 14 months ago by aldeck

Works now! kudos :)

r29078

  Changed 14 months ago by mmlr

  • status changed from assigned to closed
  • resolution set to fixed

Thanks for the feedback. Closing.

Note: See TracTickets for help on using tickets.