Index: branches/ErmaC/Trunk/version =================================================================== --- branches/ErmaC/Trunk/version (revision 2110) +++ branches/ErmaC/Trunk/version (revision 2111) @@ -1 +1 @@ -2.1svn +2.2svn Index: branches/ErmaC/Trunk/i386/libsaio/bootstruct.c =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/bootstruct.c (revision 2110) +++ branches/ErmaC/Trunk/i386/libsaio/bootstruct.c (revision 2111) @@ -185,7 +185,7 @@ DT__FlattenDeviceTree((void **)&addr, &size); bootArgs->deviceTreeP = (uint32_t)addr; bootArgs->deviceTreeLength = size; - + // Copy BootArgs values to older structure memcpy(&bootArgsPreLion->CommandLine, &bootArgs->CommandLine, BOOT_LINE_LENGTH); Index: branches/ErmaC/Trunk/i386/libsaio/acpi_patcher.c =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/acpi_patcher.c (revision 2110) +++ branches/ErmaC/Trunk/i386/libsaio/acpi_patcher.c (revision 2111) @@ -96,7 +96,7 @@ int search_and_get_acpi_fd(const char * filename, const char ** outDirspec) { int fd = 0; - char dirSpec[512] = ""; + char dirSpec[512]; // Try finding 'filename' in the usual places // Start searching any potential location for ACPI Table @@ -702,21 +702,29 @@ const char * value; // Restart Fix - if (Platform.CPU.Vendor == 0x756E6547) { /* Intel */ + if (Platform.CPU.Vendor == 0x756E6547) + { /* Intel */ fix_restart = true; fix_restart_ps2 = false; if ( getBoolForKey(kPS2RestartFix, &fix_restart_ps2, &bootInfo->chameleonConfig) && fix_restart_ps2) + { fix_restart = true; + } else + { getBoolForKey(kRestartFix, &fix_restart, &bootInfo->chameleonConfig); } - else - { - verbose ("Not an Intel platform: Restart Fix not applied !!!\n"); - fix_restart = false; } + else + { + verbose ("Not an Intel platform: Restart Fix not applied !!!\n"); + fix_restart = false; + } - if (fix_restart) fadt_rev2_needed = true; + if (fix_restart) + { + fadt_rev2_needed = true; + } // Allocate new fadt table if (fadt->Length < 0x84 && fadt_rev2_needed) @@ -737,13 +745,19 @@ if (Platform.Type > 6) { if(fadt_mod->PM_Profile<=6) + { Platform.Type = fadt_mod->PM_Profile; // get the fadt if correct - else + } + else + { Platform.Type = 1; /* Set a fixed value (Desktop) */ + } verbose("Error: system-type must be 0..6. Defaulting to %d !\n", Platform.Type); } else + { Platform.Type = (unsigned char) strtoul(value, NULL, 10); + } } // Set PM_Profile from System-type if only user wanted this value to be forced if (fadt_mod->PM_Profile != Platform.Type) @@ -799,7 +813,9 @@ fadt_mod->DSDT=(uint32_t)new_dsdt; if ((uint32_t)(&(fadt_mod->X_DSDT))-(uint32_t)fadt_mod+8<=fadt_mod->Length) + { fadt_mod->X_DSDT=(uint32_t)new_dsdt; + } DBG("New @%x,%x\n",fadt_mod->DSDT,fadt_mod->X_DSDT); @@ -1048,8 +1064,8 @@ // FIXME: handle 64-bit address correctly xsdt=(struct acpi_2_xsdt*) ((uint32_t)rsdp->XsdtAddress); - DBG("XSDT @%x;%x, Length=%d\n", (uint32_t)(rsdp->XsdtAddress>>32),(uint32_t)rsdp->XsdtAddress, - xsdt->Length); + DBG("XSDT @%x;%x, Length=%d\n", (uint32_t)(rsdp->XsdtAddress>>32),(uint32_t)rsdp->XsdtAddress, xsdt->Length); + if (xsdt && (uint64_t)rsdp->XsdtAddress<0xffffffff && xsdt->Length<0x10000) { uint64_t *xsdt_entries; @@ -1071,6 +1087,7 @@ continue; } xsdt_entries[i-dropoffset]=xsdt_entries[i]; + if (drop_ssdt && tableSign(table, "SSDT")) { dropoffset++; Index: branches/ErmaC/Trunk/i386/libsaio/Makefile =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/Makefile (revision 2110) +++ branches/ErmaC/Trunk/i386/libsaio/Makefile (revision 2111) @@ -19,10 +19,9 @@ CFLAGS := $(CFLAGS) $(RC_CFLAGS) $(MORECPP) -arch i386 \ -D__ARCHITECTURE__=\"i386\" -DSAIO_INTERNAL_USER \ - -DRCZ_COMPRESSED_FILE_SUPPORT \ - -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h + -DRCZ_COMPRESSED_FILE_SUPPORT -fno-stack-protector \ + -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h CPPFLAGS := $(CPPFLAGS) -nostdinc++ Index: branches/ErmaC/Trunk/i386/libsaio/gma.c =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/gma.c (revision 2110) +++ branches/ErmaC/Trunk/i386/libsaio/gma.c (revision 2111) @@ -180,8 +180,10 @@ model, gma_dev->vendor_id, gma_dev->device_id, devicepath); if (!string) + { string = devprop_create_string(); - + } + struct DevPropDevice *device = malloc(sizeof(struct DevPropDevice)); device = devprop_add_device(string, devicepath); @@ -195,19 +197,19 @@ devprop_add_value(device, "model", (uint8_t*)model, (strlen(model) + 1)); devprop_add_value(device, "device_type", (uint8_t*)"display", 8); - if ((model == (char *)"Mobile GMA950") || (model == (char *)"Mobile GMA3150")) + if ((model == (char *)&"Mobile GMA950") || (model == (char *)&"Mobile GMA3150")) { devprop_add_value(device, "AAPL,HasPanel", reg_TRUE, 4); devprop_add_value(device, "built-in", &BuiltIn, 1); devprop_add_value(device, "class-code", ClassFix, 4); } - else if ((model == (char *)"Desktop GMA950") || (model == (char *)"Desktop GMA3150")) + else if ((model == (char *)&"Desktop GMA950") || (model == (char *)&"Desktop GMA3150")) { BuiltIn = 0x01; devprop_add_value(device, "built-in", &BuiltIn, 1); devprop_add_value(device, "class-code", ClassFix, 4); } - else if (model == (char *)"GMAX3100") + else if (model == (char *)&"GMAX3100") { BuiltIn = gDualLink; devprop_add_value(device, "AAPL,HasPanel", GMAX3100_vals[0], 4); @@ -237,7 +239,7 @@ devprop_add_value(device, "subsystem-vendor-id", GMAX3100_vals[21], 4); devprop_add_value(device, "subsystem-id", GMAX3100_vals[22], 4); } - else if (model == (char *)"Intel HD Graphics 2000 Mobile") + else if (model == (char *)&"Intel HD Graphics 2000 Mobile") { devprop_add_value(device, "class-code", ClassFix, 4); devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); @@ -258,7 +260,7 @@ devprop_add_value(device, "AAPL,tbl-info", HD2000_tbl_info, 18); devprop_add_value(device, "AAPL,os-info", HD2000_os_info, 20); } - else if (model == (char *)"Intel HD Graphics 3000 Mobile") + else if (model == (char *)&"Intel HD Graphics 3000 Mobile") { devprop_add_value(device, "class-code", ClassFix, 4); devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); @@ -279,7 +281,7 @@ devprop_add_value(device, "AAPL,tbl-info", HD3000_tbl_info, 18); devprop_add_value(device, "AAPL,os-info", HD3000_os_info, 20); } - else if (model == (char *)"Intel HD Graphics 2000") + else if (model == (char *)&"Intel HD Graphics 2000") { devprop_add_value(device, "built-in", &BuiltIn, 1); devprop_add_value(device, "class-code", ClassFix, 4); @@ -288,7 +290,7 @@ devprop_add_value(device, "AAPL,tbl-info", HD2000_tbl_info, 18); devprop_add_value(device, "AAPL,os-info", HD2000_os_info, 20); } - else if (model == (char *)"Intel HD Graphics 3000") + else if (model == (char *)&"Intel HD Graphics 3000") { devprop_add_value(device, "built-in", &BuiltIn, 1); devprop_add_value(device, "class-code", ClassFix, 4); @@ -298,7 +300,7 @@ devprop_add_value(device, "AAPL,tbl-info", HD3000_tbl_info, 18); devprop_add_value(device, "AAPL,os-info", HD3000_os_info, 20); } - else if (model == (char *)"Intel HD Graphics 4000") + else if (model == (char *)&"Intel HD Graphics 4000") { devprop_add_value(device, "built-in", &BuiltIn, 1); devprop_add_value(device, "class-code", ClassFix, 4); Index: branches/ErmaC/Trunk/i386/libsaio/nvidia.c =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/nvidia.c (revision 2110) +++ branches/ErmaC/Trunk/i386/libsaio/nvidia.c (revision 2111) @@ -1658,11 +1658,20 @@ { 0x10DE1211, 0x15587101, "Clevo GeForce GTX 580M" }, { 0x10DE1211, 0x15587200, "Clevo GeForce GTX 580M" }, + { 0x10DE1212, 0x10280550, "Dell GeForce GTX 675M" }, + { 0x10DE1212, 0x10280551, "Dell GeForce GTX 675M" }, { 0x10DE1212, 0x1028057B, "Dell GeForce GTX 675M" }, + { 0x10DE1212, 0x10280580, "Dell GeForce GTX 675M" }, { 0x10DE1212, 0x10DE095D, "nVidia GeForce GTX 675M" }, { 0x10DE1212, 0x144DC0D0, "Samsung GeForce GTX 675M" }, { 0x10DE1212, 0x146210CB, "MSi GeForce GTX 675M" }, + { 0x10DE1212, 0x15580270, "Clevo GeForce GTX 675M" }, + { 0x10DE1212, 0x15580271, "Clevo GeForce GTX 675M" }, + { 0x10DE1212, 0x15585105, "Clevo GeForce GTX 675M" }, + { 0x10DE1212, 0x15587102, "Clevo GeForce GTX 675M" }, + { 0x10DE1213, 0x10432119, "Asus GeForce GTX 670M" }, + { 0x10DE1213, 0x10432120, "Asus GeForce GTX 670M" }, { 0x10DE1213, 0x102804BA, "Dell GeForce GTX 670M" }, { 0x10DE1213, 0x10432119, "Dell GeForce GTX 670M" }, { 0x10DE1213, 0x10432120, "Dell GeForce GTX 670M" }, @@ -1671,7 +1680,10 @@ { 0x10DE1213, 0x1179FB18, "Toshiba GeForce GTX 670M" }, { 0x10DE1213, 0x1179FB1A, "Toshiba GeForce GTX 670M" }, { 0x10DE1213, 0x146210CB, "MSi GeForce GTX 670M" }, + { 0x10DE1213, 0x15580371, "Clevo GeForce GTX 670M" }, { 0x10DE1213, 0x15585105, "Clevo GeForce GTX 670M" }, + { 0x10DE1213, 0x15587102, "Clevo GeForce GTX 670M" }, + { 0x10DE1213, 0x15588000, "Clevo GeForce GTX 670M" }, { 0x10DE1241, 0x10DE091D, "nVidia GeForce GT 545" }, @@ -3246,6 +3258,7 @@ else { printf("ERROR: unable to open nVidia Video BIOS File %s\n", nvFilename); + free(rom); return false; } } Index: branches/ErmaC/Trunk/i386/libsaio/ati.c =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/ati.c (revision 2110) +++ branches/ErmaC/Trunk/i386/libsaio/ati.c (revision 2111) @@ -401,7 +401,7 @@ /* Evergreen */ { 0x6898, 0x00D0106B, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kLangur }, { 0x6898, 0x032E1043, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kUakari }, - { 0x6898, 0x038C1043, CHIP_FAMILY_CYPRESS, "ASUS 5870 Eyefinity 6", kNull }, + { 0x6898, 0x038C1043, CHIP_FAMILY_CYPRESS, "ASUS 5870 Eyefinity 6", kNull }, { 0x6898, 0x0B001002, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kZonalis }, { 0x6898, 0x21E51458, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kUakari }, { 0x6898, 0x29611682, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kUakari }, Index: branches/ErmaC/Trunk/i386/libsaio/disk.c =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/disk.c (revision 2110) +++ branches/ErmaC/Trunk/i386/libsaio/disk.c (revision 2111) @@ -1385,6 +1385,10 @@ goto scanErr; } buffer = malloc(bufferSize); + if (!buffer) + { + goto scanErr; + } if (readBytes(biosdev, gptBlock, 0, bufferSize, buffer) != 0) { @@ -1394,6 +1398,10 @@ // Allocate a new map for this BIOS device and insert it into the chain map = malloc(sizeof(*map)); + if (!map) + { + goto scanErr; + } map->biosdev = biosdev; map->bvr = NULL; map->bvrcnt = 0; @@ -1534,7 +1542,10 @@ } scanErr: - free(buffer); + if (buffer) + { + free(buffer); + } if(map) { @@ -1593,6 +1604,24 @@ valid = false; } + if(!valid) + { + int fh = -1; + sprintf(dirSpec, "hd(%d,%d)/.PhysicalMediaInstall", BIOS_DEV_UNIT(bvr), bvr->part_no); + fh = open(dirSpec, 0); + + if (fh >= 0) + { + valid = true; + bvr->OSisInstaller = true; + strcpy(bvr->OSVersion, "10.7"); // 10.7 + + } + else + { + close(fh); + } + } + return valid; } @@ -2082,8 +2111,8 @@ return; } - strcpy(str + len, " "); - len++; + strcpy(str + len, bvr->OSisInstaller ? " (Installer) " : " "); + len += bvr->OSisInstaller ? 13 : 1; strMaxLen -= len; p += len; } Index: branches/ErmaC/Trunk/i386/libsaio/openbsd.h =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/openbsd.h (revision 2110) +++ branches/ErmaC/Trunk/i386/libsaio/openbsd.h (revision 2111) @@ -1,2 +1,7 @@ +#ifndef __LIBSAIO_OPENBSD_H +#define __LIBSAIO_OPENBSD_H + extern bool OpenBSDProbe (const void *buf); -extern void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen); \ No newline at end of file +extern void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen); + +#endif /* !__LIBSAIO_OPENBSD_H */ Index: branches/ErmaC/Trunk/i386/libsaio/nvidia_helper.c =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/nvidia_helper.c (revision 2110) +++ branches/ErmaC/Trunk/i386/libsaio/nvidia_helper.c (revision 2111) @@ -91,7 +91,7 @@ entry = cardList; while(entry) { - if((entry->id == id)) + if(entry->id == id) { return entry; } @@ -143,4 +143,4 @@ } } } -} \ No newline at end of file +} Index: branches/ErmaC/Trunk/i386/libsaio/stringTable.c =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/stringTable.c (revision 2110) +++ branches/ErmaC/Trunk/i386/libsaio/stringTable.c (revision 2111) @@ -623,6 +623,7 @@ { char *dirspec[] = { "/Library/Preferences/SystemConfiguration/com.apple.Boot.plist", + "/OS X Install Data/com.apple.Boot.plist", }; int i, fd, count, ret=-1; Index: branches/ErmaC/Trunk/i386/libsaio/freebsd.h =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/freebsd.h (revision 2110) +++ branches/ErmaC/Trunk/i386/libsaio/freebsd.h (revision 2111) @@ -1,2 +1,7 @@ +#ifndef __LIBSAIO_FREEBSD_H +#define __LIBSAIO_FREEBSD_H + extern bool FreeBSDProbe (const void *buf); -extern void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen); \ No newline at end of file +extern void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen); + +#endif /* !__LIBSAIO_FREEBSD_H */ Index: branches/ErmaC/Trunk/i386/libsaio/saio_types.h =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/saio_types.h (revision 2110) +++ branches/ErmaC/Trunk/i386/libsaio/saio_types.h (revision 2111) @@ -214,6 +214,8 @@ bool visible; /* will shown in the device list */ char OSVersion[8]; bool OSisServer; /* 1 = OS X server , 0 = OS X client */ + bool OSisInstaller; /* 1 = OS X Install partition / recover partition , 0 = OS X Install */ + }; enum Index: branches/ErmaC/Trunk/i386/libsaio/fake_efi.c =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/fake_efi.c (revision 2110) +++ branches/ErmaC/Trunk/i386/libsaio/fake_efi.c (revision 2111) @@ -686,7 +686,7 @@ */ static void setupSmbiosConfigFile(const char *filename) { - char dirSpecSMBIOS[128] = ""; + char dirSpecSMBIOS[128]; const char *override_pathname = NULL; int len = 0, err = 0; extern void scan_mem(); Index: branches/ErmaC/Trunk/i386/include/mach/mach.h =================================================================== --- branches/ErmaC/Trunk/i386/include/mach/mach.h (revision 2110) +++ branches/ErmaC/Trunk/i386/include/mach/mach.h (revision 2111) @@ -1,7 +1,6 @@ /* * Copyright (c) 1999-2005 Apple Computer, Inc. All rights reserved. * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License @@ -23,9 +22,6 @@ * Please see the License for the specific language governing rights and * limitations under the License. * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. @@ -49,9 +45,7 @@ * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. - */ - -/* + * * Includes all the types that a normal user * of Mach programs should need */ Index: branches/ErmaC/Trunk/i386/include/unwind.h =================================================================== --- branches/ErmaC/Trunk/i386/include/unwind.h (revision 2110) +++ branches/ErmaC/Trunk/i386/include/unwind.h (revision 2111) @@ -32,8 +32,10 @@ #define _UNWIND_H #ifndef HIDE_EXPORTS +#ifdef __GCC__ #pragma GCC visibility push(default) #endif +#endif #ifdef __cplusplus extern "C" { @@ -235,7 +237,9 @@ #endif #ifndef HIDE_EXPORTS +#ifdef __GCC__ #pragma GCC visibility pop #endif +#endif #endif /* unwind.h */ Index: branches/ErmaC/Trunk/i386/klibc/Makefile =================================================================== --- branches/ErmaC/Trunk/i386/klibc/Makefile (revision 2110) +++ branches/ErmaC/Trunk/i386/klibc/Makefile (revision 2111) @@ -14,8 +14,7 @@ CFLAGS := $(CFLAGS) $(RC_CFLAGS) $(MORECPP) -arch i386 \ -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float \ + -march=pentium4 -msse2 -msoft-float -fno-stack-protector \ -nostdinc -include $(SRCROOT)/autoconf.h CPPFLAGS := $(CPPFLAGS) -nostdinc++ Index: branches/ErmaC/Trunk/i386/boot2/picopng.c =================================================================== --- branches/ErmaC/Trunk/i386/boot2/picopng.c (revision 2110) +++ branches/ErmaC/Trunk/i386/boot2/picopng.c (revision 2111) @@ -65,13 +65,21 @@ return; } if (node->prev) + { node->prev->next = node->next; + } if (node->next) + { node->next->prev = node->prev; + } if (node == png_alloc_head) + { png_alloc_head = node->next; + } if (node == png_alloc_tail) + { png_alloc_tail = node->prev; + } node->prev = node->next = node->addr = NULL; free(node); } @@ -85,16 +93,25 @@ void *png_alloc_realloc(void *addr, size_t size) { - void *new_addr; + void *new_addr = NULL; if (!addr) + { return png_alloc_malloc(size); - new_addr = realloc(addr, size); - if (new_addr && (new_addr != addr)) { - png_alloc_node_t *old_node; - old_node = png_alloc_find_node(addr); - png_alloc_remove_node(old_node); - png_alloc_add_node(new_addr, size); } + + png_alloc_node_t *old_node; + old_node = png_alloc_find_node(addr); + + if (old_node) + { + new_addr = realloc(addr, size); + if (new_addr && (new_addr != addr)) + { + png_alloc_remove_node(old_node); + png_alloc_add_node(new_addr, size); + } + } + return new_addr; } Index: branches/ErmaC/Trunk/i386/boot2/Makefile =================================================================== --- branches/ErmaC/Trunk/i386/boot2/Makefile (revision 2110) +++ branches/ErmaC/Trunk/i386/boot2/Makefile (revision 2111) @@ -21,9 +21,8 @@ OPTIM = -Os -Oz CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost -Werror \ - -fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h + -fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h CPPFLAGS := $(CPPFLAGS) -nostdinc++ -include $(SRCROOT)/autoconf.h @@ -65,6 +64,8 @@ DATA_ADDR = $(shell printf "%d" `otool -l $(SYMROOT)/boot.sys | grep __data -A 4 | grep __DATA -A 3 | head -n 2 | tail -n 1 | cut -f 8 -d " "`) PATCH_ADDR = $(shell echo ${SYMBOL_ADDR}-${DATA_ADDR}+${DATA_OFFSET} | bc) +#### NOTE #### This value is currently *not* calculated and *should* be. It is currently determined experimentally… +DATA_PAD = 3582 all: $(DIRS_NEEDED) boot all-recursive @@ -78,27 +79,37 @@ endif + @${MKDIRS} $(OBJROOT)/../boot2_modules/ - @${MKDIRS} $(OBJROOT)/../boot2_modules/ + @### First pass, don't worry abount segment alignment. @echo "\t[LD] boot.sys" - @$(BINROOT)/ld_classic -static -segalign 20 -segaddr __INIT $(BOOT2ADDR) -preload \ - -arch i386 -e boot2 \ - -o $(SYMROOT)/boot.sys $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) `find /usr/llvm-gcc-*/lib/gcc/*/*/ -name \libcc_kext.a` + @$(CC) -Wl,-preload -Wl,-alias,boot2,start \ + -nostdlib -arch i386 -Wl,-pie \ + -Wl,-read_only_relocs,suppress \ + -lcc_kext \ + $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \ + -o ${SYMROOT}/$@.sys + ifeq (${CONFIG_MODULES}, y) - @cp $(SYMROOT)/boot.sys $(SYMROOT)/boot2.sys - @# Generate the Symbols.dylib file @echo "\t[dyldsymboltool] Symbols.dylib" @$(SYMROOT)/dyldsymboltool $(SYMROOT)/boot.sys $(SYMROOT)/${SYMBOLS_MODULE} @echo "\t[LD] boot.sys" - @$(BINROOT)/ld_classic -static -segalign 20 -segaddr __INIT $(BOOT2ADDR) -preload \ - -arch i386 -e boot2\ - -sectcreate __DATA __Symbols $(SYMROOT)/Symbols.dylib \ - -o $(SYMROOT)/boot.sys $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) `find /usr/llvm-gcc-*/lib/gcc/*/*/ -name \libcc_kext.a` + @$(CC) -Wl,-preload -Wl,-alias,boot2,start \ + -nostdlib -arch i386 -Wl,-pie \ + -Wl,-sectcreate,__DATA,__Symbols,$(SYMROOT)/Symbols.dylib \ + -Wl,-segaddr,__INIT,`echo obase=16\; $$((0x${BOOT2ADDR})) | bc` \ + -Wl,-segaddr,__TEXT,`echo obase=16\; $$((0x${BOOT2ADDR})) + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` | bc` \ + -Wl,-segaddr,__DATA,`echo obase=16\; $$((0x${BOOT2ADDR})) + ${DATA_PAD} + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __TEXT\` | bc` \ + -Wl,-read_only_relocs,suppress \ + -lcc_kext \ + $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \ + -o ${SYMROOT}/$@.sys + @# Second pass, fixup global var locations @${RM} $(SYMROOT)/${SYMBOLS_MODULE} @@ -106,14 +117,19 @@ @echo "\t[dyldsymboltool] Symbols.dylib" @$(SYMROOT)/dyldsymboltool $(SYMROOT)/boot.sys $(SYMROOT)/${SYMBOLS_MODULE} - @${RM} $(SYMROOT)/boot.sys @echo "\t[LD] boot.sys" - @$(BINROOT)/ld_classic -static -segalign 20 -segaddr __INIT $(BOOT2ADDR) -preload \ - -arch i386 \ - -sectcreate __DATA __Symbols $(SYMROOT)/Symbols.dylib \ - -o $(SYMROOT)/boot.sys $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) `find /usr/llvm-gcc-*/lib/gcc/*/*/ -name \libcc_kext.a` + @$(CC) -Wl,-preload -Wl,-alias,boot2,start \ + -nostdlib -arch i386 -Wl,-pie \ + -Wl,-sectcreate,__DATA,__Symbols,$(SYMROOT)/Symbols.dylib \ + -Wl,-segaddr,__INIT,`echo obase=16\; $$((0x${BOOT2ADDR})) | bc` \ + -Wl,-segaddr,__TEXT,`echo obase=16\; $$((0x${BOOT2ADDR})) + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` | bc` \ + -Wl,-segaddr,__DATA,`echo obase=16\; $$((0x${BOOT2ADDR})) + ${DATA_PAD} + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __TEXT\` | bc` \ + -Wl,-read_only_relocs,suppress \ + -lcc_kext \ + $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \ + -o ${SYMROOT}/$@.sys - @${RM} $(SYMROOT)/${SYMBOLS_MODULE} + @#${RM} $(SYMROOT)/${SYMBOLS_MODULE} @$(LD) -arch i386 \ -undefined dynamic_lookup \ @@ -125,12 +141,22 @@ -macosx_version_min 10.6 \ -o $(OBJROOT)/Symbols_LINKER_ONLY.dylib +else + @echo "\t[LD] boot.sys" + @$(CC) -Wl,-preload -Wl,-alias,boot2,start \ + -nostdlib -arch i386 -Wl,-pie \ + -Wl,-segaddr,__INIT,`echo obase=16\; $$((0x${BOOT2ADDR})) | bc` \ + -Wl,-segaddr,__TEXT,`echo obase=16\; $$((0x${BOOT2ADDR})) + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` | bc` \ + -Wl,-segaddr,__DATA,`echo obase=16\; $$((0x${BOOT2ADDR})) + ${DATA_PAD} + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __TEXT\` | bc` \ + -Wl,-read_only_relocs,suppress \ + -lcc_kext \ + $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \ + -o ${SYMROOT}/$@.sys endif - @# this is done in a sub process after boot.sys exists so the strings are populated correctly - @make embed_symbols - @${RM} $(SYMROOT)/boot2.sys + @echo "\t[MACHOCONV] boot" + @$(SYMROOT)/machOconv ${SYMROOT}/$@.sys $(SYMROOT)/$@ &> /dev/null @( size=`ls -l $(SYMROOT)/boot | awk '{ print $$5}'` ; \ if expr "$$size" ">" "$(MAXBOOTSIZE)" > /dev/null ;\ @@ -143,18 +169,6 @@ echo "\t******* boot is $$size bytes *******"; \ fi) -embed_symbols: -ifeq (${CONFIG_MODULES}, y) - @echo ================= Embedding Symbols.dylib ================= - @echo "\t[MACHOCONV] boot" - @$(SYMROOT)/machOconv $(SYMROOT)/boot2.sys $(SYMROOT)/boot &> /dev/null - - @echo "\t******* Patching at $(PATCH_ADDR) ******" - @stat -f%z $(SYMROOT)/boot | perl -ane "print pack('V',@F[0]);" | dd conv=notrunc of=${SYMROOT}/boot.sys bs=1 count=4 seek=$(PATCH_ADDR) &> /dev/null -endif - @echo "\t[MACHOCONV] boot" - @$(SYMROOT)/machOconv $(SYMROOT)/boot.sys $(SYMROOT)/boot - $(SYMROOT)/art.h: @if [ "$(PNGCRUSH)" ]; then \ echo "optimizing art files ...\n$(PNGCRUSH) $(PNGOPTIONS) artwork/$(THEME)"; \ Index: branches/ErmaC/Trunk/i386/boot2/boot.c =================================================================== --- branches/ErmaC/Trunk/i386/boot2/boot.c (revision 2110) +++ branches/ErmaC/Trunk/i386/boot2/boot.c (revision 2111) @@ -91,11 +91,13 @@ static void zeroBSS(void) { - extern char _DATA__bss__begin, _DATA__bss__end; - extern char _DATA__common__begin, _DATA__common__end; + extern char bss_start __asm("section$start$__DATA$__bss"); + extern char bss_end __asm("section$end$__DATA$__bss"); + extern char common_start __asm("section$start$__DATA$__common"); + extern char common_end __asm("section$end$__DATA$__common"); - bzero(&_DATA__bss__begin, (&_DATA__bss__end - &_DATA__bss__begin)); - bzero(&_DATA__common__begin, (&_DATA__common__end - &_DATA__common__begin)); + bzero(&bss_start, (&bss_end - &bss_start)); + bzero(&common_start, (&common_end - &common_start)); } //========================================================================== @@ -374,13 +376,7 @@ // Since the kernel cache file exists and is the most recent try to load it verbose("Loading kernel cache %s\n", kernelCachePath); - if ((checkOSVersion("10.7")) || (checkOSVersion("10.8"))) - { - ret = LoadThinFatFile(kernelCachePath, binary); - } else { - ret = LoadFile(kernelCachePath); - *binary = (void *)kLoadAddr; - } + ret = LoadThinFatFile(kernelCachePath, binary); return ret; // ret contain the length of the binary } @@ -528,7 +524,7 @@ while (1) { bool tryresume, tryresumedefault, forceresume; - bool useKernelCache = false; // by default don't use prelink kernel cache + bool useKernelCache = true; // by default try to use the prelinked kernel const char *val; int len, ret = -1; long flags, sleeptime, time; @@ -663,15 +659,7 @@ verbose("Loading Darwin %s\n", gMacOSVersion); - // If boot from boot helper partitions and OS is Mountain Lion or Lion use prelink kernel. - // We need to find a solution to load extra mkext with a prelink kernel. - if (gBootVolume->flags & kBVFlagBooter && ((checkOSVersion("10.7")) || (checkOSVersion("10.8")))) - useKernelCache = true; - else - useKernelCache = false; // by default don't use prelink kernel cache - getBoolForKey(kUseKernelCache, &useKernelCache, &bootInfo->chameleonConfig); - if (useKernelCache) do { // Determine the name of the Kernel Cache Index: branches/ErmaC/Trunk/i386/boot2/modules.c =================================================================== --- branches/ErmaC/Trunk/i386/boot2/modules.c (revision 2110) +++ branches/ErmaC/Trunk/i386/boot2/modules.c (revision 2111) @@ -2,18 +2,18 @@ * Copyright 2010 Evan Lojewski. All rights reserved. * */ -#ifdef CONFIG_MODULES -#ifndef CONFIG_MODULE_DEBUG -#define CONFIG_MODULE_DEBUG 0 -#endif - #include "boot.h" #include "bootstruct.h" #include "modules.h" #include "boot_modules.h" #include +#ifdef CONFIG_MODULES +#ifndef CONFIG_MODULE_DEBUG +#define CONFIG_MODULE_DEBUG 0 +#endif + #if CONFIG_MODULE_DEBUG #define DBG(x...) printf(x); #define DBGPAUSE() getchar() @@ -23,11 +23,9 @@ #endif // NOTE: Global so that modules can link with this -UInt64 textAddress = 0; -UInt64 textSection = 0; +static UInt64 textAddress = 0; +static UInt64 textSection = 0; -void* symbols_module_start = (void*)0xFFFFFFFF; // Global, value is populated by the makefile with actual address - /** Internal symbols, however there are accessor methods **/ moduleHook_t* moduleCallbacks = NULL; moduleList_t* loadedModules = NULL; @@ -48,10 +46,12 @@ int retVal = 0; void (*module_start)(void) = NULL; - char* module_data = symbols_module_start + BOOT2_ADDR; + + extern char symbols_start __asm("section$start$__DATA$__Symbols"); + char* module_data = &symbols_start; // Intialize module system - if(symbols_module_start != (void*)0xFFFFFFFF) + if(module_data) { // Module system was compiled in (Symbols.dylib addr known) module_start = parse_mach(module_data, &load_module, &add_symbol, NULL); @@ -60,7 +60,6 @@ { // Notify the system that it was laoded module_loaded(SYMBOLS_MODULE, SYMBOLS_AUTHOR, SYMBOLS_DESCRIPTION, SYMBOLS_VERSION, SYMBOLS_COMPAT); - (*module_start)(); // Start the module. This will point to load_all_modules due to the way the dylib was constructed. execute_hook("ModulesLoaded", NULL, NULL, NULL, NULL); DBG("Module %s Loaded.\n", SYMBOLS_MODULE); @@ -69,25 +68,8 @@ } else { - module_data -= 0x10; // XCODE 4 HACK - module_start = parse_mach(module_data, &load_module, &add_symbol, NULL); - - if(module_start && module_start != (void*)0xFFFFFFFF) - { - // Notify the system that it was laoded - module_loaded(SYMBOLS_MODULE, SYMBOLS_AUTHOR, SYMBOLS_DESCRIPTION, SYMBOLS_VERSION, SYMBOLS_COMPAT); - - (*module_start)(); // Start the module. This will point to load_all_modules due to the way the dylib was constructed. - execute_hook("ModulesLoaded", NULL, NULL, NULL, NULL); - DBG("Module %s Loaded.\n", SYMBOLS_MODULE); - retVal = 1; - - } - else - { - // The module does not have a valid start function - printf("Unable to start %s\n", SYMBOLS_MODULE); getchar(); - } + // The module does not have a valid start function + printf("Unable to start %s at 0x%x\n", SYMBOLS_MODULE, module_data); pause(); } } return retVal; @@ -105,7 +87,6 @@ module_loaded(name, author, description, version, compat); } - /* * Load all modules in the /Extra/modules/ directory * Module depencdies will be loaded first @@ -326,7 +307,7 @@ void* parse_mach(void* binary, int(*dylib_loader)(char*), long long(*symbol_handler)(char*, long long, char), - void (*section_handler)(char* section, char* segment, long long offset, long long address) + void (*section_handler)(char* section, char* segment, void* cmd, UInt64 offset, UInt64 address) ) { char is64 = false; @@ -361,14 +342,13 @@ } else if(((struct mach_header_64*)binary)->magic == MH_MAGIC_64) { - // NOTE: modules cannot be 64bit... + // NOTE: modules cannot be 64bit. This is used to parse the kernel and kexts is64 = true; binaryIndex += sizeof(struct mach_header_64); } else { - //verbose("Invalid mach magic 0x%X\n", ((struct mach_header*)binary)->magic); - //getchar(); + verbose("Invalid mach magic 0x%X\n", ((struct mach_header*)binary)->magic); return NULL; } @@ -411,10 +391,8 @@ sectionIndex += sizeof(struct section); - if(section_handler) section_handler(sect->sectname, segCommand->segname, sect->offset, sect->addr); + if(section_handler) section_handler(sect->sectname, segCommand->segname, (void*)sect, sect->offset, sect->addr); - - if((strcmp("__TEXT", segCommand->segname) == 0) && (strcmp("__text", sect->sectname) == 0)) { // __TEXT,__text found, save the offset and address for when looking for the calls. @@ -439,10 +417,9 @@ sectionIndex += sizeof(struct section_64); - if(section_handler) section_handler(sect->sectname, segCommand->segname, sect->offset, sect->addr); - - - if((strcmp("__TEXT", segCommand->segname) == 0) && (strcmp("__text", sect->sectname) == 0)) + if(section_handler) section_handler(sect->sectname, segCommand64->segname, (void*)sect, sect->offset, sect->addr); + + if((strcmp("__TEXT", segCommand64->segname) == 0) && (strcmp("__text", sect->sectname) == 0)) { // __TEXT,__text found, save the offset and address for when looking for the calls. textSection = sect->offset; @@ -1151,4 +1128,28 @@ { return 0; } + +void register_hook_callback(const char* name, void(*callback)(void*, void*, void*, void*)) +{ + printf("WARNING: register_hook_callback is not supported when compiled in.\n"); + pause(); +} + +int replace_function(const char* symbol, void* newAddress) +{ + printf("WARNING: replace_functions is not supported when compiled in.\n"); + pause(); + return 0; +} + +void start_built_in_module(const char* name, + const char* author, + const char* description, + UInt32 version, + UInt32 compat, + void(*start_function)(void)) +{ + start_function(); +} + #endif Index: branches/ErmaC/Trunk/i386/boot2/modules.h =================================================================== --- branches/ErmaC/Trunk/i386/boot2/modules.h (revision 2110) +++ branches/ErmaC/Trunk/i386/boot2/modules.h (revision 2111) @@ -21,8 +21,6 @@ #define SYMBOLS_COMPAT 0 #define VOID_SYMBOL "dyld_void_start" -extern UInt64 textAddress; -extern UInt64 textSection; @@ -90,7 +88,7 @@ void* parse_mach(void* binary, int(*dylib_loader)(char*), long long(*symbol_handler)(char*, long long, char), - void (*section_handler)(char* section, char* segment, long long offset, long long address) + void (*section_handler)(char* section, char* segment, void* cmd, UInt64 offset, UInt64 address) ); unsigned int handle_symtable(UInt32 base, struct symtab_command* symtabCommand, @@ -121,4 +119,4 @@ /********************************************************************************/ void dyld_stub_binder(); -#endif /* __BOOT_MODULES_H */ \ No newline at end of file +#endif /* __BOOT_MODULES_H */ Index: branches/ErmaC/Trunk/i386/boot2/gui.c =================================================================== --- branches/ErmaC/Trunk/i386/boot2/gui.c (revision 2110) +++ branches/ErmaC/Trunk/i386/boot2/gui.c (revision 2111) @@ -1223,7 +1223,7 @@ return; } -inline void vramwrite (void *data, int width, int height) +static inline void vramwrite (void *data, int width, int height) { if (VIDEO (depth) == 32 && VIDEO (rowBytes) == gui.backbuffer->width * 4) { Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iostream =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iostream (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iostream (revision 2111) @@ -29,8 +29,6 @@ #include #include -#pragma GCC visibility push(default) - namespace std{ #ifdef __UCLIBCXX_SUPPORT_CIN__ extern istream cin; @@ -96,6 +94,4 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/cstdarg =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/cstdarg (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/cstdarg (revision 2111) @@ -43,8 +43,6 @@ #ifndef _CPP_CSTDARG #define _CPP_CSTDARG 1 -#pragma GCC system_header - #include // Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/unwind-cxx.h =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/unwind-cxx.h (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/unwind-cxx.h (revision 2111) @@ -38,10 +38,8 @@ #include #include #include -#include "unwind.h" +//#include -#pragma GCC visibility push(default) - namespace __cxxabiv1 { @@ -135,30 +133,6 @@ // The current installed user handlers. extern std::terminate_handler __terminate_handler; extern std::unexpected_handler __unexpected_handler; - -// These are explicitly GNU C++ specific. - -// This is the exception class we report -- "GNUCC++\0". -const _Unwind_Exception_Class __gxx_exception_class -= ((((((((_Unwind_Exception_Class) 'G' - << 8 | (_Unwind_Exception_Class) 'N') - << 8 | (_Unwind_Exception_Class) 'U') - << 8 | (_Unwind_Exception_Class) 'C') - << 8 | (_Unwind_Exception_Class) 'C') - << 8 | (_Unwind_Exception_Class) '+') - << 8 | (_Unwind_Exception_Class) '+') - << 8 | (_Unwind_Exception_Class) '\0'); - -// GNU C++ personality routine, Version 0. -extern "C" _Unwind_Reason_Code __gxx_personality_v0 - (int, _Unwind_Action, _Unwind_Exception_Class, - struct _Unwind_Exception *, struct _Unwind_Context *); - -// GNU C++ sjlj personality routine, Version 0. -extern "C" _Unwind_Reason_Code __gxx_personality_sj0 - (int, _Unwind_Action, _Unwind_Exception_Class, - struct _Unwind_Exception *, struct _Unwind_Context *); - #ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ // Acquire the C++ exception header from the C++ object. @@ -177,6 +151,4 @@ #endif } /* namespace __cxxabiv1 */ -#pragma GCC visibility pop - #endif // _UNWIND_CXX_H Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iomanip =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iomanip (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iomanip (revision 2111) @@ -23,8 +23,6 @@ #ifndef __STD_IOMANIP #define __STD_IOMANIP 1 -#pragma GCC visibility push(default) - namespace std{ // These are the helper classes which we are going to be using to @@ -164,7 +162,5 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/numeric =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/numeric (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/numeric (revision 2111) @@ -23,8 +23,6 @@ #ifndef __STD_NUMERIC_HEADER #define __STD_NUMERIC_HEADER 1 -#pragma GCC visibility push(default) - namespace std{ template _UCXXEXPORT T accumulate(InputIterator first, InputIterator last, T init) @@ -155,7 +153,5 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/utility =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/utility (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/utility (revision 2111) @@ -24,8 +24,6 @@ #ifndef __STD_HEADER_UTILITY #define __STD_HEADER_UTILITY 1 -#pragma GCC visibility push(default) - namespace std{ namespace rel_ops { @@ -83,6 +81,4 @@ } -#pragma GCC visibility pop - #endif //__STD_HEADER_UTILITY Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/type_traits =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/type_traits (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/type_traits (revision 2111) @@ -25,8 +25,6 @@ #ifndef __HEADER_TYPE_TRAITS #define __HEADER_TYPE_TRAITS 1 -#pragma GCC visibility push(default) - namespace std{ struct _UCXXEXPORT __true_type{}; @@ -86,7 +84,5 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/memory =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/memory (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/memory (revision 2111) @@ -27,8 +27,6 @@ #ifndef HEADER_STD_MEMORY #define HEADER_STD_MEMORY 1 -#pragma GCC visibility push(default) - namespace std{ template class allocator; @@ -190,7 +188,5 @@ } //namespace std -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/cstddef =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/cstddef (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/cstddef (revision 2111) @@ -43,10 +43,6 @@ #ifndef _CPP_CSTDDEF #define _CPP_CSTDDEF 1 -#ifdef __GCC__ -#pragma GCC system_header -#endif - #include namespace std Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/map =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/map (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/map (revision 2111) @@ -29,8 +29,6 @@ #ifndef __STD_HEADER_MAP #define __STD_HEADER_MAP -#pragma GCC visibility push(default) - namespace std{ @@ -254,8 +252,6 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iterator =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iterator (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iterator (revision 2111) @@ -28,8 +28,6 @@ #ifndef __STD_HEADER_ITERATOR #define __STD_HEADER_ITERATOR 1 -#pragma GCC visibility push(default) - namespace std{ // subclause _lib.stream.iterators_, stream iterators: @@ -164,7 +162,7 @@ } bool equal(const istreambuf_iterator& b) const{ - return sbuf == b.sbuf || is_eof() && b.is_eof(); + return sbuf == b.sbuf || (is_eof() && b.is_eof()); } private: streambuf_type* sbuf; @@ -222,8 +220,6 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/bitset =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/bitset (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/bitset (revision 2111) @@ -27,8 +27,6 @@ #ifndef __STD_BITSET_HEADER #define __STD_BITSET_HEADER 1 -#pragma GCC visibility push(default) - namespace std{ template class bitset; @@ -417,7 +415,5 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/set =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/set (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/set (revision 2111) @@ -28,8 +28,6 @@ #ifndef __STD_HEADER_SET #define __STD_HEADER_SET -#pragma GCC visibility push(default) - namespace std{ @@ -400,8 +398,6 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iosfwd =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iosfwd (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iosfwd (revision 2111) @@ -25,11 +25,9 @@ #ifndef __HEADER_STD_IOSFWD #define __HEADER_STD_IOSFWD 1 -#pragma GCC visibility push(default) - namespace std { class ios_base; - template<> class char_traits; + template<> struct char_traits; #ifdef __UCLIBCXX_HAS_WCHAR__ template<> class char_traits; @@ -109,6 +107,4 @@ #endif } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/limits =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/limits (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/limits (revision 2111) @@ -23,8 +23,6 @@ //#warning limits header is nowhere complete or accurate -#pragma GCC visibility push(default) - namespace std{ enum float_round_style{ @@ -610,6 +608,4 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/functional =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/functional (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/functional (revision 2111) @@ -21,8 +21,6 @@ #include -#pragma GCC visibility push(default) - namespace std{ template struct unary_function; @@ -46,9 +44,9 @@ template struct logical_or; template struct logical_not; - template struct unary_negate; + template class unary_negate; template unary_negate not1(const Predicate&); - template struct binary_negate; + template class binary_negate; template binary_negate not2(const Predicate&); @@ -431,8 +429,6 @@ return binary_compose(fn1, fn2, fn3); } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/istream =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/istream (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/istream (revision 2111) @@ -26,8 +26,6 @@ #ifndef __STD_HEADER_ISTREAM #define __STD_HEADER_ISTREAM 1 -#pragma GCC visibility push(default) - namespace std{ typedef basic_istream istream; @@ -98,15 +96,15 @@ basic_ios::mstreambuf->sbumpc(); if(c == traits::eof() ){ if(i==0){ - basic_ios::setstate(ios_base::failbit); + //basic_ios::setstate(ios_base::failbit); }else{ - basic_ios::setstate(ios_base::eofbit); + //basic_ios::setstate(ios_base::eofbit); } break; } if(c == delim){ if(i==0){ - basic_ios::setstate(ios_base::failbit); + //basic_ios::setstate(ios_base::failbit); } basic_ios::mstreambuf->sputbackc(c); break; @@ -130,16 +128,16 @@ c = basic_ios::mstreambuf->sgetc(); if(c == traits::eof()){ if(i==0){ - basic_ios::setstate(ios_base::failbit); + //basic_ios::setstate(ios_base::failbit); }else{ - basic_ios::setstate(ios_base::eofbit); + //basic_ios::setstate(ios_base::eofbit); } count_last_ufmt_input = i; return *this; } if(c == delim){ if(i==0){ - basic_ios::setstate(ios_base::failbit); + //basic_ios::setstate(ios_base::failbit); } count_last_ufmt_input = i; return *this; @@ -165,16 +163,16 @@ c = basic_ios::mstreambuf->sgetc(); if(c == traits::eof() ){ if( basic_ios::eof() ){ - basic_ios::setstate(ios_base::failbit); + //basic_ios::setstate(ios_base::failbit); }else{ - basic_ios::setstate(ios_base::eofbit); + //basic_ios::setstate(ios_base::eofbit); } count_last_ufmt_input = i; s[i] = traits::eos(); return *this; } if(basic_ios::mstreambuf->sbumpc()==traits::eof() ){ - basic_ios::setstate(ios_base::eofbit); + //basic_ios::setstate(ios_base::eofbit); } if(c == delim){ count_last_ufmt_input = i+1; @@ -194,7 +192,7 @@ for(i=0;i::mstreambuf->sgetc(); if(c == traits::eof()){ - basic_ios::setstate(ios_base::eofbit); + //basic_ios::setstate(ios_base::eofbit); return *this; } basic_ios::mstreambuf->sbumpc(); @@ -211,7 +209,7 @@ }else{ int_type c = basic_ios::mstreambuf->sgetc(); if(c == traits::eof()){ - basic_ios::setstate(ios_base::eofbit); + //basic_ios::setstate(ios_base::eofbit); } return basic_ios::mstreambuf->sgetc(); } @@ -225,8 +223,8 @@ c = basic_ios::mstreambuf->sgetc(); if(c == traits::eof()){ - basic_ios::setstate(ios_base::failbit); - basic_ios::setstate(ios_base::eofbit); + //basic_ios::setstate(ios_base::failbit); + //basic_ios::setstate(ios_base::eofbit); count_last_ufmt_input = i; return *this; } @@ -241,13 +239,13 @@ sentry(*this, true); if(!basic_ios::good()){ count_last_ufmt_input = 0; - basic_ios::setstate(ios_base::failbit); + //basic_ios::setstate(ios_base::failbit); return 0; } if( basic_ios::mstreambuf->in_avail() == -1){ count_last_ufmt_input=0; - basic_ios::setstate(ios_base::eofbit); + //basic_ios::setstate(ios_base::eofbit); return 0; } @@ -270,15 +268,15 @@ _UCXXEXPORT basic_istream& putback(char_type c){ sentry(*this, true); if(!basic_ios::good()){ - basic_ios::setstate(ios_base::failbit); + //basic_ios::setstate(ios_base::failbit); return *this; } if(basic_ios::mstreambuf == 0){ - basic_ios::setstate(ios_base::badbit); + //basic_ios::setstate(ios_base::badbit); return *this; } if(basic_ios::mstreambuf->sputbackc(c) == traits::eof()){ - basic_ios::setstate(ios_base::badbit); + //basic_ios::setstate(ios_base::badbit); return *this; } return *this; @@ -287,15 +285,15 @@ _UCXXEXPORT basic_istream& unget(){ sentry(*this, true); if(!basic_ios::good()){ - basic_ios::setstate(ios_base::failbit); + //basic_ios::setstate(ios_base::failbit); return *this; } if(basic_ios::mstreambuf == 0){ - basic_ios::setstate(ios_base::failbit); + //basic_ios::setstate(ios_base::failbit); return *this; } if(basic_ios::mstreambuf->sungetc() == traits::eof()){ - basic_ios::setstate(ios_base::failbit); + //basic_ios::setstate(ios_base::failbit); } return *this; } @@ -306,7 +304,7 @@ return -1; } if(basic_ios::mstreambuf->pubsync() == -1){ - basic_ios::setstate(ios_base::badbit); + //basic_ios::setstate(ios_base::badbit); return traits::eof(); } return 0; @@ -340,7 +338,7 @@ }; - template > class _UCXXEXPORT basic_istream::sentry { + template */ > class _UCXXEXPORT basic_istream::sentry { bool ok; public: explicit _UCXXEXPORT sentry(basic_istream& os, bool noskipws = false){ @@ -372,7 +370,7 @@ int_type retval = basic_ios::mstreambuf->sgetc(); if(retval == traits::eof()){ count_last_ufmt_input = 0; - basic_ios::setstate(ios_base::eofbit); + //basic_ios::setstate(ios_base::eofbit); }else{ count_last_ufmt_input = 1; basic_ios::mstreambuf->sbumpc(); @@ -386,8 +384,8 @@ int_type retval = basic_ios::mstreambuf->sgetc(); if(retval == traits::eof()){ count_last_ufmt_input = 0; - basic_ios::setstate(ios_base::eofbit); - basic_ios::setstate(ios_base::failbit); + //basic_ios::setstate(ios_base::eofbit); + //basic_ios::setstate(ios_base::failbit); }else{ count_last_ufmt_input = 1; c = traits::to_char_type(retval); @@ -595,7 +593,5 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/stack =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/stack (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/stack (revision 2111) @@ -21,8 +21,6 @@ #ifndef __HEADER_STD_STACK #define __HEADER_STD_STACK 1 -#pragma GCC visibility push(default) - namespace std{ template > class _UCXXEXPORT stack{ @@ -77,8 +75,6 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/string =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/string (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/string (revision 2111) @@ -33,8 +33,6 @@ #ifndef __HEADER_STD_STRING #define __HEADER_STD_STRING 1 -#pragma GCC visibility push(default) - namespace std{ //Basic basic_string @@ -426,7 +424,7 @@ } _UCXXEXPORT size_type find (Ch c, size_type pos = 0) const{ for(size_type i = pos; i < length(); ++i){ - if(operator[](i) == c){ + if(this->operator[](i) == c){ return i; } } @@ -456,7 +454,7 @@ _UCXXEXPORT size_type find_first_of(const basic_string& str, size_type pos = 0) const{ for(size_type i = pos; i < length(); ++i){ for(size_type j = 0; j < str.length() ; ++j){ - if( Tr::eq(str[j], operator[](i)) ){ + if( Tr::eq(str[j], this->operator[](i)) ){ return i; } } @@ -472,7 +470,7 @@ } _UCXXEXPORT size_type find_first_of(Ch c, size_type pos = 0) const{ for(size_type i = pos; i< length(); ++i){ - if( Tr::eq(operator[](i), c) ){ + if( Tr::eq(this->operator[](i), c) ){ return i; } } @@ -485,7 +483,7 @@ } for(size_type i = pos; i >0 ; --i){ for(size_type j = 0 ; j < str.length(); ++j){ - if( Tr::eq(operator[](i-1), str[j]) ){ + if( Tr::eq(this->operator[](i-1), str[j]) ){ return i-1; } } @@ -503,7 +501,7 @@ pos = length(); } for(size_type i = pos; i >0 ; --i){ - if( Tr::eq(operator[](i-1), c) ){ + if( Tr::eq(this->operator[](i-1), c) ){ return i-1; } } @@ -515,7 +513,7 @@ for(size_type i = pos; i < length(); ++i){ foundCharacter = false; for(size_type j = 0; j < str.length() ; ++j){ - if( Tr::eq(str[j], operator[](i)) ){ + if( Tr::eq(str[j], this->operator[](i)) ){ foundCharacter = true; } } @@ -534,7 +532,7 @@ } _UCXXEXPORT size_type find_first_not_of(Ch c, size_type pos = 0) const{ for(size_type i = pos; i < length() ; ++i){ - if(operator[](i) != c){ + if(this->operator[](i) != c){ return i; } } @@ -1017,11 +1015,11 @@ template <> _UCXXEXPORT bool operator==(const string & lhs, const string & rhs); template <> _UCXXEXPORT bool operator==(const char * lhs, const string & rhs); -template <> _UCXXEXPORT bool operator==(const string & rhs, const char * rhs); +template <> _UCXXEXPORT bool operator==(const string & lhs, const char * rhs); template <> _UCXXEXPORT bool operator!=(const string & lhs, const string & rhs); template <> _UCXXEXPORT bool operator!=(const char * lhs, const string & rhs); -template <> _UCXXEXPORT bool operator!=(const string & rhs, const char * rhs); +template <> _UCXXEXPORT bool operator!=(const string & lhs, const char * rhs); template <> _UCXXEXPORT string operator+(const string & lhs, const char* rhs); template <> _UCXXEXPORT string operator+(const char* lhs, const string & rhs); @@ -1037,6 +1035,4 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ostream =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ostream (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ostream (revision 2111) @@ -27,8 +27,6 @@ #include #include -#pragma GCC visibility push(default) - namespace std { template class basic_ostream; typedef basic_ostream ostream; @@ -91,7 +89,7 @@ basic_ios::mstreambuf->sputc(c), basic_ostream::traits_type::eof())) { - basic_ios::setstate(ios_base::eofbit); + //basic_ios::setstate(ios_base::eofbit); } return *this; } @@ -100,13 +98,13 @@ basic_ios::mstreambuf->sputn(s, n), basic_ostream::traits_type::eof()) ){ - basic_ios::setstate(ios_base::eofbit); + //basic_ios::setstate(ios_base::eofbit); } return *this; } _UCXXEXPORT basic_ostream& flush(){ if(basic_ios::mstreambuf->pubsync() == -1){ - basic_ios::setstate(ios_base::badbit); + //basic_ios::setstate(ios_base::badbit); } return *this; } @@ -231,7 +229,7 @@ { sentry s(*this); if(sb == 0){ - basic_ios::setstate(ios_base::badbit); + //basic_ios::setstate(ios_base::badbit); return *this; } @@ -275,7 +273,7 @@ #endif #endif - template > + template */ > class _UCXXEXPORT basic_ostream::sentry { bool ok; @@ -477,7 +475,5 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/sstream =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/sstream (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/sstream (revision 2111) @@ -29,8 +29,6 @@ #include #include -#pragma GCC visibility push(default) - namespace std{ template @@ -376,8 +374,6 @@ #endif #endif -#pragma GCC visibility pop - } Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/csignal =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/csignal (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/csignal (revision 2111) @@ -44,8 +44,6 @@ #ifndef _CPP_CSIGNAL #define _CPP_CSIGNAL 1 -#pragma GCC system_header - #include // Get rid of those macros defined in in lieu of real functions. Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/valarray =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/valarray (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/valarray (revision 2111) @@ -25,8 +25,6 @@ #include #include -#pragma GCC visibility push(default) - namespace std{ template class valarray; @@ -991,6 +989,4 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iterator_base =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iterator_base (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iterator_base (revision 2111) @@ -22,8 +22,6 @@ #ifndef __STD_HEADER_ITERATOR_BASE #define __STD_HEADER_ITERATOR_BASE 1 -#pragma GCC visibility push(default) - namespace std{ template struct iterator_traits; template struct iterator_traits; @@ -298,8 +296,6 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/algorithm =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/algorithm (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/algorithm (revision 2111) @@ -27,8 +27,6 @@ #undef min #undef max -#pragma GCC visibility push(default) - namespace std{ // subclause _lib.alg.nonmodifying_, non-modifying sequence operations: @@ -1687,8 +1685,6 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/istream_helpers =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/istream_helpers (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/istream_helpers (revision 2111) @@ -25,8 +25,6 @@ #ifndef __STD_HEADER_ISTREAM_HELPERS #define __STD_HEADER_ISTREAM_HELPERS 1 -#pragma GCC visibility push(default) - namespace std{ @@ -56,8 +54,8 @@ break; } } - if (temp.size() == 0) - stream.setstate(ios_base::eofbit|ios_base::failbit); + //if (temp.size() == 0) + //stream.setstate(ios_base::eofbit|ios_base::failbit); return temp; } @@ -76,8 +74,8 @@ break; } } - if (temp.size() == 0) - stream.setstate(ios_base::eofbit|ios_base::failbit); + //if (temp.size() == 0) + //stream.setstate(ios_base::eofbit|ios_base::failbit); return temp; } @@ -331,13 +329,11 @@ is.rdbuf()->sbumpc(); } if(traits::eq_int_type(c, eof)){ - is.setstate(ios_base::eofbit); + //is.setstate(ios_base::eofbit); } } } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ostream_helpers =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ostream_helpers (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ostream_helpers (revision 2111) @@ -21,13 +21,12 @@ #include #include #include +#include #include #ifndef __STD_HEADER_OSTREAM_HELPERS #define __STD_HEADER_OSTREAM_HELPERS 1 -#pragma GCC visibility push(default) - namespace std{ /* We are making the following template class for serveral reasons. Firstly, @@ -482,8 +481,6 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/locale =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/locale (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/locale (revision 2111) @@ -24,8 +24,6 @@ #ifndef __HEADER_STD_LOCALE #define __HEADER_STD_LOCALE 1 -#pragma GCC visibility push(default) - namespace std{ class _UCXXEXPORT locale { public: @@ -78,6 +76,4 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/vector =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/vector (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/vector (revision 2111) @@ -29,8 +29,6 @@ #ifndef __STD_HEADER_VECTOR #define __STD_HEADER_VECTOR -#pragma GCC visibility push(default) - namespace std{ template > class vector; @@ -511,7 +509,5 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/deque =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/deque (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/deque (revision 2111) @@ -21,8 +21,6 @@ #include #include -#pragma GCC visibility push(default) - #ifndef __STD_HEADER_DEQUE #define __STD_HEADER_DEQUE @@ -802,8 +800,6 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/stdexcept =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/stdexcept (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/stdexcept (revision 2111) @@ -27,8 +27,6 @@ //Don't include support if not needed #ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ -#pragma GCC visibility push(default) - namespace std{ //typedef basic_string string; @@ -111,7 +109,5 @@ } -#pragma GCC visibility pop - #endif #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/list =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/list (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/list (revision 2111) @@ -24,8 +24,6 @@ #ifndef __STD_HEADER_LIST #define __STD_HEADER_LIST 1 -#pragma GCC visibility push(default) - namespace std{ template > class _UCXXEXPORT list { @@ -62,18 +60,7 @@ list(const list& x); ~list(); - list& operator=(const list& x){ - if(&x == this){ - return *this; - } - clear(); - iterator i = x.begin(); - while(i != x.end()){ - push_back(*i); - ++i; - } - return *this; - } + list& operator=(const list& x); template void assign(InputIterator first, InputIterator last); template void assign(Size n, const U& u = U()); @@ -547,6 +534,20 @@ } } + template list& list:: operator=(const list& x){ + if(&x == this){ + return *this; + } + clear(); + iterator i = x.begin(); + while(i != x.end()){ + push_back(*i); + ++i; + } + return *this; + } + + template void list::splice(iterator position, list& x) { @@ -920,8 +921,6 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/basic_definitions =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/basic_definitions (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/basic_definitions (revision 2111) @@ -20,8 +20,6 @@ #include -#pragma GCC visibility push(default) - //The following is used to support GCC symbol visibility patch #ifdef GCC_HASCLASSVISIBILITY @@ -54,8 +52,6 @@ typedef signed long int streamsize; } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/cwctype =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/cwctype (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/cwctype (revision 2111) @@ -44,8 +44,6 @@ #ifndef _CPP_CWCTYPE #define _CPP_CWCTYPE 1 -#pragma GCC system_header - //#include #ifdef __UCLIBCXX_HAS_WCHAR__ Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/queue =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/queue (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/queue (revision 2111) @@ -23,8 +23,6 @@ #ifndef __HEADER_STD_QUEUE #define __HEADER_STD_QUEUE 1 -#pragma GCC visibility push(default) - namespace std{ template > class _UCXXEXPORT queue{ @@ -119,8 +117,6 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/streambuf =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/streambuf (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/streambuf (revision 2111) @@ -27,8 +27,6 @@ #include -#pragma GCC visibility push(default) - namespace std{ template class _UCXXEXPORT basic_streambuf{ @@ -324,6 +322,4 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/new =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/new (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/new (revision 2111) @@ -24,8 +24,6 @@ #ifndef __STD_NEW_OPERATOR #define __STD_NEW_OPERATOR 1 -#pragma GCC visibility push(default) - namespace std{ class _UCXXEXPORT bad_alloc : public exception {}; @@ -58,7 +56,5 @@ inline void* operator new[](std::size_t, void *p) throw() { return p; } inline void operator delete[](void* , void *) throw() {} -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ios =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ios (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ios (revision 2111) @@ -25,8 +25,6 @@ #ifndef __HEADER_STD_IOS #define __HEADER_STD_IOS 1 -#pragma GCC visibility push(default) - namespace std{ typedef signed long int streamoff; @@ -495,7 +493,5 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/fstream =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/fstream (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/fstream (revision 2111) @@ -39,8 +39,6 @@ #include #endif //__UCLIBCXX_HAS_WCHAR__ -#pragma GCC visibility push(default) - namespace std{ template class basic_filebuf; @@ -671,8 +669,6 @@ } -#pragma GCC visibility pop - #endif -#endif \ No newline at end of file +#endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ctime =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ctime (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ctime (revision 2111) @@ -44,8 +44,6 @@ #ifndef _CPP_CTIME #define _CPP_CTIME 1 -#pragma GCC system_header - #include #include Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/char_traits =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/char_traits (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/char_traits (revision 2111) @@ -21,10 +21,6 @@ #include #include -#ifdef __UCLIBCXX_HAS_WCHAR__ -#include -#include -#endif #ifndef __HEADER_CHAR_TRAITS #define __HEADER_CHAR_TRAITS 1 @@ -105,93 +101,11 @@ } } static state_type get_state(pos_type p){ - p = p; - state_type a; + //p = p; + state_type a = 0; return a; } }; - - -#ifdef __UCLIBCXX_HAS_WCHAR__ - template<> struct _UCXXEXPORT char_traits { - typedef wchar_t char_type; - typedef wint_t int_type; - typedef char_traits_off_type off_type; - typedef char_traits_off_type pos_type; - typedef mbstate_t state_type; - - static void assign(char_type & c, const char_type & d){ c=d; } - - static char_type to_char_type(const int_type & i){ - return i; - } - - static int_type to_int_type(const char_type & c){ - return c; - } - - inline static bool eq_int_type(const int_type & a, const int_type & b){ - if(a==b){ - return true; - } - return false; - } - - inline static bool eq(const char_type& c1, const char_type& c2){ - if(wcsncmp(&c1, &c2, 1) == 0){ - return true; - } - return false; - } - - inline static bool lt(const char_type& c1, const char_type& c2){ - if(wcsncmp(&c1, &c2, 1) < 0){ - return true; - } - return false; - } - - inline static char_type* move(char_type* s1, const char_type* s2, size_t n){ - return (char_type*) memmove(s1, s2, n * sizeof(char_type)); - } - - inline static char_type* copy(char_type* s1, const char_type* s2, size_t n){ - for(unsigned long int i=0; i< n; ++i){ - assign(s1[i], s2[i]); - } - return s1 + n; - } - - inline static char_type* assign(char_type* s, size_t n, char_type a){ - return (char_type *)memset(s, a, n); /*FIXME*/ - } - - inline static int compare(const char_type* s1, const char_type* s2, size_t n){ - return wcsncmp(s1, s2, n); - } - - inline static size_t length(const char_type* s){ - return wcslen(s); - } - - static const char_type* find(const char_type* s, int n, const char_type& a); - - inline static char_type eos() { return 0; } - inline static int_type eof() { return WEOF; } - inline static int_type not_eof(const int_type & i) { - if(i == WEOF){ - return (int_type)0; - } else { - return i; - } - } - static state_type get_state(pos_type){ - state_type a; - return a; - } - }; -#endif - } #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/associative_base =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/associative_base (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/associative_base (revision 2111) @@ -28,8 +28,6 @@ #ifndef __STD_HEADER_ASSOCIATIVE_BASE #define __STD_HEADER_ASSOCIATIVE_BASE -#pragma GCC visibility push(default) - namespace std{ @@ -513,7 +511,7 @@ pair insert(const value_type& x){ pair retval; - iterator location = lower_bound(value_to_key(x)); + iterator location = lower_bound(this->value_to_key(x)); retval.second = true; //Empty list or need to insert at end if(end() == location){ @@ -522,7 +520,7 @@ return retval; } //Something in the list - if(c(value_to_key(x), value_to_key(*location))){ + if(c(this->value_to_key(x), this->value_to_key(*location))){ location = backing.insert(location.base_iterator(), x); retval.first = location; }else{ @@ -636,8 +634,6 @@ } -#pragma GCC visibility pop - #endif //__STD_HEADER_ASSOCIATIVE_BASE Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/func_exception =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/func_exception (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/func_exception (revision 2111) @@ -24,8 +24,6 @@ #ifndef HEADER_IMPLEMENTATION_FUNC_EXCEPTION #define HEADER_IMPLEMENTATION_FUNC_EXCEPTION -#pragma GCC visibility push(default) - namespace std{ _UCXXEXPORT void __throw_bad_alloc(); @@ -35,7 +33,5 @@ _UCXXEXPORT void __throw_invalid_argument(const char * message = 0); } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/include/string_iostream =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/include/string_iostream (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/include/string_iostream (revision 2111) @@ -29,8 +29,6 @@ #ifndef __HEADER_STD_STRING_IOSTREAM #define __HEADER_STD_STRING_IOSTREAM 1 -#pragma GCC visibility push(default) - namespace std{ @@ -140,7 +138,5 @@ } -#pragma GCC visibility pop - #endif Index: branches/ErmaC/Trunk/i386/modules/uClibcxx/string.cpp =================================================================== --- branches/ErmaC/Trunk/i386/modules/uClibcxx/string.cpp (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/uClibcxx/string.cpp (revision 2111) @@ -76,11 +76,11 @@ template _UCXXEXPORT bool operator==(const string & lhs, const string & rhs); template _UCXXEXPORT bool operator==(const char * lhs, const string & rhs); - template _UCXXEXPORT bool operator==(const string & rhs, const char * rhs); + template _UCXXEXPORT bool operator==(const string & lhs, const char * rhs); template _UCXXEXPORT bool operator!=(const string & lhs, const string & rhs); template _UCXXEXPORT bool operator!=(const char * lhs, const string & rhs); - template _UCXXEXPORT bool operator!=(const string & rhs, const char * rhs); + template _UCXXEXPORT bool operator!=(const string & lhs, const char * rhs); template _UCXXEXPORT string operator+(const string & lhs, const char* rhs); template _UCXXEXPORT string operator+(const char* lhs, const string & rhs); Index: branches/ErmaC/Trunk/i386/modules/MakeInc.dir =================================================================== --- branches/ErmaC/Trunk/i386/modules/MakeInc.dir (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/MakeInc.dir (revision 2111) @@ -18,28 +18,24 @@ ifeq ($(BUILT_IN),yes) CFLAGS := $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost -Werror \ - -fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h + -fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h -CPPFLAGS := $(CPPFLAGS) -arch i386 -static -nostdinc++ -Wmost -Werror \ - -fno-builtin -mpreferred-stack-boundary=2 \ - -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float \ +CPPFLAGS := $(CPPFLAGS) -arch i386 -static -nostdinc -Wmost -Werror \ + -fno-builtin -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float \ -arch i386 -include $(SRCROOT)/autoconf.h else CFLAGS := $(CLFAGS) -nostdinc -Wmost -Werror \ - -fno-builtin -mpreferred-stack-boundary=2 \ - -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float \ + -fno-builtin -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float \ -arch i386 -include $(SRCROOT)/autoconf.h -CPPFLAGS := $(CPPFLAGS) -nostdinc++ -Wmost -Werror \ - -fno-builtin -mpreferred-stack-boundary=2 \ - -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float \ +CPPFLAGS := $(CPPFLAGS) -nostdinc -Wmost -Werror \ + -fno-builtin -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float \ -arch i386 -include $(SRCROOT)/autoconf.h endif Index: branches/ErmaC/Trunk/i386/modules/Keylayout/layouts/Makefile =================================================================== --- branches/ErmaC/Trunk/i386/modules/Keylayout/layouts/Makefile (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/Keylayout/layouts/Makefile (revision 2111) @@ -8,7 +8,7 @@ INC = -I$(SRCROOT)/i386/libsaio/ -I. -I.. -OBJS = cham-mklayout.o32_nodep cham-mklayout.o64_nodep #in case we use our own md, we can't make these files with the standard rules, it too early, md doesn't even exist +OBJS = cham-mklayout.o32 cham-mklayout.o64 OBJS := $(addprefix $(OBJROOT)/, $(OBJS)) @@ -30,10 +30,10 @@ $(PROGRAMS): $(OBJS) @echo "\t[LD32] $(@F)_32" @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) $(INCLUDES) -arch i386 \ - -o $(SYMROOT)/$(@F)_32 $(OBJROOT)/$(@F).o32_nodep + -o $(SYMROOT)/$(@F)_32 $(OBJROOT)/$(@F).o32 @echo "\t[LD64] $(@F)_64" @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) $(INCLUDES) -arch x86_64 \ - -o $(SYMROOT)/$(@F)_64 $(OBJROOT)/$(@F).o64_nodep + -o $(SYMROOT)/$(@F)_64 $(OBJROOT)/$(@F).o64 @echo "\t[LIPO] $(@F)" @lipo -create -arch i386 $(SYMROOT)/$(@F)_32 -arch x86_64 $(SYMROOT)/$(@F)_64 \ -output $(SYMROOT)/$(@F) Index: branches/ErmaC/Trunk/i386/modules/KernelPatcher/Cconfig =================================================================== --- branches/ErmaC/Trunk/i386/modules/KernelPatcher/Cconfig (revision 0) +++ branches/ErmaC/Trunk/i386/modules/KernelPatcher/Cconfig (revision 2111) @@ -0,0 +1,10 @@ +# +# Chameleon Modules +# + +config KERNELPATCHER_MODULE + bool "KernelPatcher Module" + default y + ---help--- + Say Y here if you want to enable to use of this module. + Index: branches/ErmaC/Trunk/i386/modules/KernelPatcher/KernelPatcher.dylib =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/ErmaC/Trunk/i386/modules/KernelPatcher/KernelPatcher.dylib ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Index: branches/ErmaC/Trunk/i386/modules/KernelPatcher/Makefile =================================================================== --- branches/ErmaC/Trunk/i386/modules/KernelPatcher/Makefile (revision 0) +++ branches/ErmaC/Trunk/i386/modules/KernelPatcher/Makefile (revision 2111) @@ -0,0 +1,20 @@ +MODULE_NAME = KernelPatcher +MODULE_AUTHOR = Evan Lojewski +MODULE_DESCRIPTION = Kernel patcher +MODULE_VERSION = "1.1.0" +MODULE_COMPAT_VERSION = "1.0.0" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = + +DIR = KernelPatcher + + + +include ../MakeInc.dir + +$(SYMROOT)/modules/$(MODULE_NAME).dylib: + @echo "\t[CP] $(MODULE_NAME).dylib" + @cp $(MODULE_NAME).dylib $(SRCROOT)/sym/i386/modules/$(MODULE_NAME).dylib + +$(SRCROOT)/sym/i386/boot_modules.c: + @ Index: branches/ErmaC/Trunk/i386/modules/Cconfig =================================================================== --- branches/ErmaC/Trunk/i386/modules/Cconfig (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/Cconfig (revision 2111) @@ -10,4 +10,5 @@ source "i386/modules/Sata/Cconfig" source "i386/modules/Keylayout/Cconfig" source "i386/modules/ACPIcodec/Cconfig" +source "i386/modules/KernelPatcher/Cconfig" endmenu Index: branches/ErmaC/Trunk/i386/modules/AcpiCodec/acpi_codec.c =================================================================== --- branches/ErmaC/Trunk/i386/modules/AcpiCodec/acpi_codec.c (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/AcpiCodec/acpi_codec.c (revision 2111) @@ -5056,98 +5056,102 @@ getBoolForKey(kSTRIPAPIC, &strip_madt, &bootInfo->chameleonConfig); - if ((strip_madt == false) || (!buildMADT(new_table_list, DsdtPtr, &madt_info ))) + if ((strip_madt == false) || (!buildMADT(new_table_list, DsdtPtr, &madt_info ))) { - ACPI_TABLE_MADT * madt_file = (void*)0ul; - ACPI_TABLE_MADT * MadtPointer = (void*)0ul; - bool oem_apic=false; + ACPI_TABLE_MADT * madt_file = (void*)0ul; + ACPI_TABLE_MADT * MadtPointer = (void*)0ul; + bool oem_apic=false; - { - bool tmpval; - oem_apic=getBoolForKey(kOEMAPIC, &tmpval, &bootInfo->chameleonConfig)&&tmpval; - } + { + bool tmpval; + oem_apic=getBoolForKey(kOEMAPIC, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + } - if ((madt_file = (ACPI_TABLE_MADT *)get_new_table_in_list(new_table_list, NAMESEG("APIC"), &new_table_index)) != (void *)0ul) - { - if (oem_apic == false) - { - MadtPointer = (ACPI_TABLE_MADT *)madt_file; - } - - } else - MadtPointer = (acpi_tables.MadtPointer64 != (void*)0ul) ? (ACPI_TABLE_MADT *)acpi_tables.MadtPointer64 : (ACPI_TABLE_MADT *)acpi_tables.MadtPointer; + if ((madt_file = (ACPI_TABLE_MADT *)get_new_table_in_list(new_table_list, NAMESEG("APIC"), &new_table_index)) != (void *)0ul) + { + if (oem_apic == false) + { + MadtPointer = (ACPI_TABLE_MADT *)madt_file; + } + + } + else + MadtPointer = (acpi_tables.MadtPointer64 != (void*)0ul) ? (ACPI_TABLE_MADT *)acpi_tables.MadtPointer64 : (ACPI_TABLE_MADT *)acpi_tables.MadtPointer; + + ProcessMadtInfo(MadtPointer, &madt_info); - ProcessMadtInfo(MadtPointer, &madt_info); - - } + } - if (gen_ssdt || gen_csta || gen_psta || gen_tsta) - { - ProcessSsdt(new_table_list, DsdtPtr, &madt_info, gen_csta, gen_psta, gen_tsta ); - } - } + if (gen_ssdt || gen_csta || gen_psta || gen_tsta) + { + ProcessSsdt(new_table_list, DsdtPtr, &madt_info, gen_csta, gen_psta, gen_tsta ); + } + } - if ((rsdp_mod != (void *)0ul) && (rsdp_mod->Length >= ACPI_RSDP_REV0_SIZE) ) + if (rsdp_mod == (void *)0ul) { - if ((rsdp_mod->Revision == 0) || (gen_xsdt == true)) - { - process_rsdt(rsdp_mod, gen_xsdt, new_table_list); - goto out; - } - + printf("Error: rsdp_mod == null \n"); + return EFI_ABORTED; } - else + + if (!(rsdp_mod->Length >= ACPI_RSDP_REV0_SIZE)) { - printf("Error: Incorect ACPI RSD PTR or not found \n"); - return EFI_UNSUPPORTED; + printf("Error: rsdp_mod size is incorrect \n"); + return EFI_ABORTED; + } - - if ((GetChecksum(rsdp_mod, sizeof(ACPI_TABLE_RSDP)) == 0) && - (Revision == 2) && - (rsdplength == sizeof(ACPI_TABLE_RSDP))) - { - process_xsdt(rsdp_mod, new_table_list); - - } - else - { - printf("Warning : ACPI RSD PTR Revision 2 is incorrect, \n"); - printf(" trying to fallback to Revision 1\n"); - if ((rsdp_mod != (void *)0ul) && (rsdp_mod->Length >= ACPI_RSDP_REV0_SIZE) ) - { - process_rsdt(rsdp_mod, false, new_table_list); - - } - else + + do { + + if ((rsdp_mod->Revision == 0) || (gen_xsdt == true)) { - printf("Error: Incorect ACPI RSD PTR or not found \n"); - return EFI_UNSUPPORTED; + if (process_rsdt(rsdp_mod, gen_xsdt, new_table_list)) + break; + printf("Error : ACPI RSD PTR Revision 1 is incorrect, \n"); } - } - -out: + + if ((GetChecksum(rsdp_mod, sizeof(ACPI_TABLE_RSDP)) == 0) && + (Revision == 2) && + (rsdplength == sizeof(ACPI_TABLE_RSDP))) + { + if (process_xsdt(rsdp_mod, new_table_list)) + break; + printf("Error : ACPI RSD PTR Revision 2 is incorrect \n"); + } + + Revision = 0; // fallback to Revision 0 + + if (process_rsdt(rsdp_mod, false, new_table_list)) + break; + + printf("Error: Incorect ACPI RSD PTR or not found \n"); + return EFI_ABORTED; + + } while (0); + + // Correct the checksum of RSDP - + DBG("RSDP: Original checksum %d\n", rsdp_mod->Checksum); - + setRsdpchecksum(rsdp_mod); - + DBG("New checksum %d\n", rsdp_mod->Checksum); - + if (Revision == 2) { - DBG("RSDP: Original extended checksum %d\n", rsdp_mod->ExtendedChecksum); - + DBG("RSDP: Original extended checksum %d\n", rsdp_mod->ExtendedChecksum); + setRsdpXchecksum(rsdp_mod); - + DBG("New extended checksum %d\n", rsdp_mod->ExtendedChecksum); - + } - + verbose("ACPI Revision %d successfully patched\n", Revision); - - if (Revision == 2) + + if (Revision == 2) { /* XXX aserebln why uint32 cast if pointer is uint64 ? */ rsd_p = (U32)rsdp_mod; @@ -5159,8 +5163,8 @@ rsd_p = (U32)rsdp_mod; addConfigurationTable(&gEfiAcpiTableGuid, &rsd_p, "ACPI"); } - - + + #if DEBUG_ACPI==2 printf("Press a key to continue... (DEBUG_ACPI)\n"); getc(); @@ -5171,6 +5175,6 @@ int AcpiSetup(void) { EFI_STATUS status = setup_Acpi(); - + return (status == EFI_SUCCESS); } Index: branches/ErmaC/Trunk/i386/modules/HelloWorld/HelloWorld.cpp =================================================================== --- branches/ErmaC/Trunk/i386/modules/HelloWorld/HelloWorld.cpp (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/HelloWorld/HelloWorld.cpp (revision 2111) @@ -20,6 +20,8 @@ public: virtual void setId( int id ); virtual void printHello( void ); + virtual ~HW(); + }; void helloWorld(void* binary, void* arg2, void* arg3, void* arg4) @@ -55,3 +57,7 @@ { this->id = id; } + +HW::~HW() +{ +} Index: branches/ErmaC/Trunk/i386/modules/Makefile =================================================================== --- branches/ErmaC/Trunk/i386/modules/Makefile (revision 2110) +++ branches/ErmaC/Trunk/i386/modules/Makefile (revision 2111) @@ -11,7 +11,7 @@ include ${SRCROOT}/Make.rules # The order of building modules is important. -SUBDIRS = +SUBDIRS = KernelPatcher ifdef CONFIG_KLIBC_MODULE SUBDIRS += klibc @@ -34,11 +34,11 @@ endif ifdef CONFIG_SATA_MODULE -SUBDIRS += sata +SUBDIRS += Sata endif ifdef CONFIG_ACPICODEC_MODULE -SUBDIRS += ACPICodec +SUBDIRS += AcpiCodec endif CFLAGS= -O3 $(MORECPP) -arch i386 -g -static Index: branches/ErmaC/Trunk/i386/libsa/Makefile =================================================================== --- branches/ErmaC/Trunk/i386/libsa/Makefile (revision 2110) +++ branches/ErmaC/Trunk/i386/libsa/Makefile (revision 2111) @@ -14,8 +14,7 @@ CFLAGS := $(CFLAGS) $(RC_CFLAGS) $(MORECPP) -arch i386 \ -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float \ + -march=pentium4 -msse2 -msoft-float -fno-stack-protector \ -nostdinc -include $(SRCROOT)/autoconf.h CPPFLAGS := $(CPPFLAGS) -nostdinc++ Index: branches/ErmaC/Trunk/i386/util/dyldsymboltool.c =================================================================== --- branches/ErmaC/Trunk/i386/util/dyldsymboltool.c (revision 2110) +++ branches/ErmaC/Trunk/i386/util/dyldsymboltool.c (revision 2111) @@ -91,8 +91,15 @@ char* name = strtok(NULL, " "); name[strlen(name)-1] = 0; // remove newline sscanf(addr, "%x", &address); - if(strcmp(name, VOID_SYMBOL) == 0) start_addr = address; - add_symbol(&symbols, name, address); + if(strcmp(name, VOID_SYMBOL) == 0) + { + start_addr = address; + } + if(strcmp(name, START_SYMBOL) == 0) + { + if(!start_addr) start_addr = address; + } + else add_symbol(&symbols, name, address); } } Index: branches/ErmaC/Trunk/i386/util/segsize.c =================================================================== --- branches/ErmaC/Trunk/i386/util/segsize.c (revision 0) +++ branches/ErmaC/Trunk/i386/util/segsize.c (revision 2111) @@ -0,0 +1,128 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int infile; + +struct mach_header mh; +void * cmds; + +static bool swap_ends; + +static unsigned long swap( + unsigned long x + ) +{ + if (swap_ends) + return OSSwapInt32(x); + else + return x; +} + +int +main(int argc, char *argv[]) +{ + int nc, ncmds; + char * cp; + + if (argc == 3) { + infile = open(argv[1], O_RDONLY); + if (infile < 0) + goto usage; + } + else { + usage: + fprintf(stderr, "usage: segsize segment\n"); + exit(1); + } + + nc = read(infile, &mh, sizeof (mh)); + if (nc < 0) { + perror("read mach header"); + exit(1); + } + if (nc < (int)sizeof (mh)) { + fprintf(stderr, "read mach header: premature EOF %d\n", nc); + exit(1); + } + if (mh.magic == MH_MAGIC) + swap_ends = false; + else if (mh.magic == MH_CIGAM) + swap_ends = true; + else { + fprintf(stderr, "bad magic number %lx\n", (unsigned long)mh.magic); + exit(1); + } + + cmds = calloc(swap(mh.sizeofcmds), sizeof (char)); + if (cmds == 0) { + fprintf(stderr, "alloc load commands: no memory\n"); + exit(1); + } + nc = read(infile, cmds, swap(mh.sizeofcmds)); + if (nc < 0) { + perror("read load commands"); + exit(1); + } + if (nc < (int)swap(mh.sizeofcmds)) { + fprintf(stderr, "read load commands: premature EOF %d\n", nc); + exit(1); + } + + for ( ncmds = swap(mh.ncmds), cp = cmds; + ncmds > 0; ncmds--) { +// bool isDATA; +// unsigned vmsize; + +#define lcp ((struct load_command *)cp) + switch(swap(lcp->cmd)) { + + case LC_SEGMENT: +#define scp ((struct segment_command *)cp) + if(strcmp(scp->segname, argv[2]) == 0) + { + printf("%ld\n", swap(scp->vmsize)); +#if 0 + if (isDATA) + vmsize = swap(scp->filesize); + else + vmsize = swap(scp->vmsize); +#endif + } + break; + } + + cp += swap(lcp->cmdsize); + } + + exit(0); +} Index: branches/ErmaC/Trunk/i386/util/Makefile =================================================================== --- branches/ErmaC/Trunk/i386/util/Makefile (revision 2110) +++ branches/ErmaC/Trunk/i386/util/Makefile (revision 2111) @@ -16,8 +16,8 @@ DIR = util include ${SRCROOT}/Make.rules -PROGRAMS = machOconv dyldsymboltool -OBJS = dyldsymboltool.o32 dyldsymboltool.o64 machOconv.o32 machOconv.o64 +PROGRAMS = machOconv dyldsymboltool segsize +OBJS = dyldsymboltool.o32 dyldsymboltool.o64 machOconv.o32 machOconv.o64 segsize.o32 segsize.o64 ifeq (${CONFIG_BDMESG}, y) Index: branches/ErmaC/Trunk/i386/util/machOconv.c =================================================================== --- branches/ErmaC/Trunk/i386/util/machOconv.c (revision 2110) +++ branches/ErmaC/Trunk/i386/util/machOconv.c (revision 2111) @@ -36,14 +36,10 @@ static bool swap_ends; -static unsigned long swap( - unsigned long x -) +static unsigned long swap(unsigned long x) { - if (swap_ends) - return OSSwapInt32(x); - else - return x; + if (swap_ends) return OSSwapInt32(x); + else return x; } int @@ -54,103 +50,143 @@ int nc, ncmds; char * cp; - if (argc == 2) { - infile = open(argv[1], O_RDONLY); - if (infile < 0) - goto usage; - outfile = fileno(stdout); + if (argc == 2) + { + infile = open(argv[1], O_RDONLY); + if (infile < 0) goto usage; + outfile = fileno(stdout); } - else if (argc == 3) { + else if (argc == 3) + { infile = open(argv[1], O_RDONLY); - if (infile < 0) - goto usage; - outfile = open(argv[2], O_WRONLY|O_CREAT|O_TRUNC, 0644); - if (outfile < 0) - goto usage; + if (infile < 0) goto usage; + outfile = open(argv[2], O_WRONLY|O_CREAT|O_TRUNC, 0644); + if (outfile < 0) goto usage; } - else { -usage: + else + { + usage: fprintf(stderr, "usage: machOconv inputfile [outputfile]\n"); - exit(1); + exit(1); } nc = read(infile, &mh, sizeof (mh)); - if (nc < 0) { - perror("read mach header"); - exit(1); + if (nc < 0) + { + perror("read mach header"); + exit(1); } - if (nc < (int)sizeof (mh)) { - fprintf(stderr, "read mach header: premature EOF %d\n", nc); - exit(1); + + if (nc < (int)sizeof (mh)) + { + fprintf(stderr, "read mach header: premature EOF %d\n", nc); + exit(1); } - if (mh.magic == MH_MAGIC) - swap_ends = false; - else if (mh.magic == MH_CIGAM) - swap_ends = true; - else { + + + if (mh.magic == MH_MAGIC) swap_ends = false; + else if (mh.magic == MH_CIGAM) swap_ends = true; + else + { fprintf(stderr, "bad magic number %lx\n", (unsigned long)mh.magic); - exit(1); + exit(1); } cmds = calloc(swap(mh.sizeofcmds), sizeof (char)); - if (cmds == 0) { - fprintf(stderr, "alloc load commands: no memory\n"); - exit(1); + if (cmds == 0) + { + fprintf(stderr, "alloc load commands: no memory\n"); + exit(1); } nc = read(infile, cmds, swap(mh.sizeofcmds)); - if (nc < 0) { - perror("read load commands"); - exit(1); + if (nc < 0) + { + perror("read load commands"); + exit(1); } - if (nc < (int)swap(mh.sizeofcmds)) { - fprintf(stderr, "read load commands: premature EOF %d\n", nc); - exit(1); + if (nc < (int)swap(mh.sizeofcmds)) + { + fprintf(stderr, "read load commands: premature EOF %d\n", nc); + exit(1); } - for ( ncmds = swap(mh.ncmds), cp = cmds; - ncmds > 0; ncmds--) { + unsigned long vmstart = (unsigned long)-1; + + // First pass: determine actual load address + for (ncmds = swap(mh.ncmds), cp = cmds; + ncmds > 0; ncmds--) + { +#define lcp ((struct load_command *)cp) +#define scp ((struct segment_command *)cp) + + switch(swap(lcp->cmd)) + { + case LC_SEGMENT: + if(vmstart > swap(scp->vmaddr)) + { + vmstart = swap(scp->vmaddr); + } + } + cp += swap(lcp->cmdsize); + + } + + // Second pass: output to file. + for (ncmds = swap(mh.ncmds), cp = cmds; + ncmds > 0; ncmds--) + { +#define lcp ((struct load_command *)cp) +#define scp ((struct segment_command *)cp) + bool isDATA; unsigned vmsize; -#define lcp ((struct load_command *)cp) - switch(swap(lcp->cmd)) { + switch(swap(lcp->cmd)) + { + case LC_SEGMENT: + isDATA = (strcmp(scp->segname, "__DATA") == 0); + if (isDATA) + { + vmsize = swap(scp->filesize); + } + else + { + vmsize = swap(scp->vmsize); + } - case LC_SEGMENT: -#define scp ((struct segment_command *)cp) - isDATA = (strcmp(scp->segname, "__DATA") == 0); - if (isDATA) - vmsize = swap(scp->filesize); - else - vmsize = swap(scp->vmsize); - result = vm_allocate(mach_task_self(), &data, vmsize, true); - if (result != KERN_SUCCESS) { - mach_error("vm_allocate segment data", result); - exit(1); - } + result = vm_allocate(mach_task_self(), &data, vmsize, true); + if (result != KERN_SUCCESS) + { + mach_error("vm_allocate segment data", result); + exit(1); + } - lseek(infile, swap(scp->fileoff), L_SET); - nc = read(infile, (void *)data, swap(scp->filesize)); - if (nc < 0) { - perror("read segment data"); - exit(1); - } - if (nc < (int)swap(scp->filesize)) { - fprintf(stderr, "read segment data: premature EOF %d\n", nc); - exit(1); - } + lseek(infile, swap(scp->fileoff), L_SET); + nc = read(infile, (void *)data, swap(scp->filesize)); + if (nc < 0) { + perror("read segment data"); + exit(1); + } + if (nc < (int)swap(scp->filesize)) + { + fprintf(stderr, "read segment data: premature EOF %d\n", nc); + exit(1); + } - nc = write(outfile, (void *)data, vmsize); - if (nc < (int)vmsize) { - perror("write segment data"); - exit(1); - } - - vm_deallocate(mach_task_self(), data, vmsize); - break; + lseek(outfile, swap(scp->vmaddr) - vmstart, L_SET); + nc = write(outfile, (void *)data, vmsize); + if (nc < (int)vmsize) + { + perror("write segment data"); + exit(1); + } + + vm_deallocate(mach_task_self(), data, vmsize); + break; + } + + cp += swap(lcp->cmdsize); } - - cp += swap(lcp->cmdsize); - } - exit(0); + exit(0); } Index: branches/ErmaC/Trunk/package/Resources/templates/Localizable.strings =================================================================== --- branches/ErmaC/Trunk/package/Resources/templates/Localizable.strings (revision 2110) +++ branches/ErmaC/Trunk/package/Resources/templates/Localizable.strings (revision 2111) @@ -60,6 +60,18 @@ Source: http://cxx.uclibc.org/ Dependencies: klibc"; +"KernelPatcher_title" = "Kernel Patcher"; +"KernelPatcher_description" = "The KernelPatcher module provides patches for the following: +Enables the use of the kernelcache with /Extra/Extensions and /Extra/Extensions.mkext +Removed the CPUID check +Removes an LAPIC panic +Removes a panic in commpage_stuff_routine +Dependencies: none"; + +"KextPatcher_title" = "Kext Patcher"; +"KernelPatcher_description" = "The KextPatcher module provides patches for the following: +Dependencies: none"; + // ============================================================================ // Boot Options - The follow options are split to match the layout OptionalSettings text files. // but they can be changed to suit however anyone wants to do it. Index: branches/ErmaC/Trunk/package/buildpkg.sh =================================================================== --- branches/ErmaC/Trunk/package/buildpkg.sh (revision 2110) +++ branches/ErmaC/Trunk/package/buildpkg.sh (revision 2111) @@ -524,25 +524,27 @@ ############################### # Supported Modules # ############################### + # ACPICodec.dylib # + # KernelPatcher.dylib # + # KextPatcher.dylib # + # Keylayout.dylib # # klibc.dylib # # Resolution.dylib # + # Sata.dylib # # uClibcxx.dylib # - # Sata.dylib # - # ACPICodec.dylib # - # Keylayout.dylib # ############################### if [ "$(ls -A "${SYMROOT}/i386/modules")" ]; then { addGroupChoices "Module" # - - if [[ "${CONFIG_KLIBC_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/klibc.dylib" ]]; then + if [[ "${CONFIG_ACPICODEC_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/ACPICodec.dylib" ]]; then { - # Start build klibc package module - choiceId="klibc" - moduleFile="${choiceId}.dylib" + # Start build ACPICodec package module + choiceId="ACPICodec" + moduleFile="ACPICodec.dylib" mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" - ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" ${PKG_BUILD_DIR}/${choiceId}/Root + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root" addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \ --subst="moduleName=$choiceId" \ --subst="moduleFile=$moduleFile" \ @@ -551,21 +553,15 @@ packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules" addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}" - # End build klibc package module + # End build ACPICodec package module } fi - # - - if [[ "${CONFIG_UCLIBCXX_MODULE}" = 'm' && -n "${CONFIG_KLIBC_MODULE}" && \ - -f "${SYMROOT}/i386/modules/uClibcxx.dylib" ]]; then + if [[ "${CONFIG_RESOLUTION_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/KernelPatcher.dylib" ]]; then { - klibcPackageRefId="" - if [[ "${CONFIG_KLIBC_MODULE}" == 'm' ]];then - klibcPackageRefId=$(getPackageRefId "${modules_packages_identity}" "klibc") - fi - # Start build uClibc package module - choiceId="uClibc" - moduleFile="uClibcxx.dylib" + # Start build KernelPatcher package module + choiceId="KernelPatcher" + moduleFile="KernelPatcher.dylib" mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root" addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \ @@ -575,17 +571,16 @@ packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules" - # Add the klibc package because the uClibc module is dependent of klibc module - addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId $klibcPackageRefId" "${choiceId}" - # End build uClibc package module + addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}" + # End build KernelPatcher package module } fi # - - if [[ "${CONFIG_SATA_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/Sata.dylib" ]]; then + if [[ "${CONFIG_RESOLUTION_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/KextPatcher.dylib" ]]; then { - # Start build Sata package module - choiceId="Sata" - moduleFile="Sata.dylib" + # Start build KextPatcher package module + choiceId="KextPatcher" + moduleFile="KextPatcher.dylib" mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root" addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \ @@ -596,18 +591,52 @@ packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules" addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}" - # End build Sata package module + # End build KextPatcher package module } fi +# - + # Warning Keylayout module need additional files + if [[ "${CONFIG_KEYLAYOUT_MODULE}" = 'm' && -f "${SYMROOT}/i386/modules/Keylayout.dylib" ]]; then + { + # Start build Keylayout package module + choiceId="Keylayout" + moduleFile="${choiceId}.dylib" + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/{modules,Keymaps} + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin + layout_src_dir="${SRCROOT}/i386/modules/Keylayout/layouts/layouts-src" + if [ -d "$layout_src_dir" ];then + # Create a tar.gz from layout sources + (cd "$layout_src_dir"; \ + tar czf "${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps/layouts-src.tar.gz" README *.slt) + fi + # Adding module + ditto --noextattr --noqtn ${SYMROOT}/i386/modules/$moduleFile ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/modules + # Adding Keymaps + ditto --noextattr --noqtn ${SRCROOT}/Keymaps ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps + # Adding tools + ditto --noextattr --noqtn ${SYMROOT}/i386/cham-mklayout ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin + # Adding scripts + addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \ + --subst="moduleName=$choiceId" \ + --subst="moduleFile=$moduleFile" \ + InstallModule + packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" + + # Don't add a choice for Keylayout module + # addChoice "${choiceId}" "Module" --start-selected="false" "$packageRefId" + # End build Keylayout package module + } + fi # - - if [[ "${CONFIG_ACPICODEC_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/ACPICodec.dylib" ]]; then + if [[ "${CONFIG_KLIBC_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/klibc.dylib" ]]; then { - # Start build ACPICodec package module - choiceId="ACPICodec" - moduleFile="ACPICodec.dylib" + # Start build klibc package module + choiceId="klibc" + moduleFile="${choiceId}.dylib" mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" - ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" ${PKG_BUILD_DIR}/${choiceId}/Root addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \ --subst="moduleName=$choiceId" \ --subst="moduleFile=$moduleFile" \ @@ -616,10 +645,9 @@ packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules" addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}" - # End build ACPICodec package module + # End build klibc package module } fi - # - if [[ "${CONFIG_RESOLUTION_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/Resolution.dylib" ]]; then { @@ -639,43 +667,51 @@ # End build Resolution package module } fi +# - + if [[ "${CONFIG_SATA_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/Sata.dylib" ]]; then + { + # Start build Sata package module + choiceId="Sata" + moduleFile="Sata.dylib" + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root" + addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \ + --subst="moduleName=$choiceId" \ + --subst="moduleFile=$moduleFile" \ + InstallModule + packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules" + addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}" + # End build Sata package module + } + fi # - - # Warning Keylayout module need additional files - if [[ "${CONFIG_KEYLAYOUT_MODULE}" = 'm' && -f "${SYMROOT}/i386/modules/Keylayout.dylib" ]]; then + if [[ "${CONFIG_UCLIBCXX_MODULE}" = 'm' && -n "${CONFIG_KLIBC_MODULE}" && \ + -f "${SYMROOT}/i386/modules/uClibcxx.dylib" ]]; then { - # Start build Keylayout package module - choiceId="Keylayout" - moduleFile="${choiceId}.dylib" - mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/{modules,Keymaps} - mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin - layout_src_dir="${SRCROOT}/i386/modules/Keylayout/layouts/layouts-src" - if [ -d "$layout_src_dir" ];then - # Create a tar.gz from layout sources - (cd "$layout_src_dir"; \ - tar czf "${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps/layouts-src.tar.gz" README *.slt) + klibcPackageRefId="" + if [[ "${CONFIG_KLIBC_MODULE}" == 'm' ]];then + klibcPackageRefId=$(getPackageRefId "${modules_packages_identity}" "klibc") fi - # Adding module - ditto --noextattr --noqtn ${SYMROOT}/i386/modules/$moduleFile ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/modules - # Adding Keymaps - ditto --noextattr --noqtn ${SRCROOT}/Keymaps ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps - # Adding tools - ditto --noextattr --noqtn ${SYMROOT}/i386/cham-mklayout ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin - # Adding scripts + # Start build uClibc package module + choiceId="uClibc" + moduleFile="uClibcxx.dylib" + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root" addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \ --subst="moduleName=$choiceId" \ --subst="moduleFile=$moduleFile" \ InstallModule packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" - - # Don't add a choice for Keylayout module - # addChoice "${choiceId}" "Module" --start-selected="false" "$packageRefId" - # End build Keylayout package module + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules" + # Add the klibc package because the uClibc module is dependent of klibc module + addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId $klibcPackageRefId" "${choiceId}" + # End build uClibc package module } fi - +# - } else { Index: branches/ErmaC/Trunk/CHANGES =================================================================== --- branches/ErmaC/Trunk/CHANGES (revision 2110) +++ branches/ErmaC/Trunk/CHANGES (revision 2111) @@ -1,3 +1,5 @@ +- sync with trunk (2110) +- Merge more cparm's (security, stability, bugs fixes) improvements from his branch. - cparm : Added two boot options for High resolution display and reboot on kernel panic - cparm : Added a workaroud for Xcode 4.4.x compatibility 504B030414030100630004731141000000007D0000008B00000003000B0062696E01990700020041450308001AED80DA50DF6080B0390FE095B3BC129E1FC27C104EC97897EF27CD1175766CB18C66FF42EFB7023911BDFD5E4BC9AEEC32FF3473963F70B255581D7B74DE9F - cparm : Fixed a buffer overflow in the plist loader